home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 48 / Amiga Format CD48 (1999-12-13)(Future Publishing)(GB)(Track 1 of 2)[!][issue 2000-01].iso / -serious- / misc / datelib / developer / autodocs / date.doc next >
Text File  |  1999-11-01  |  129KB  |  5,592 lines

  1. TABLE OF CONTENTS
  2.  
  3. Date/--background--
  4. Date/Compare2Dates
  5. Date/Compare2Times
  6. Date/DateText
  7. Date/DateToJD
  8. Date/DateToNum
  9. Date/DayDiff
  10. Date/DaysAfterWeekday
  11. Date/DaysBeforeWeekday
  12. Date/DiffDateRange
  13. Date/DiffTime
  14. Date/Easter
  15. Date/FormatDate
  16. Date/FormatTime
  17. Date/GMTToLocal
  18. Date/GregorianDayDiff
  19. Date/GregorianDaysAfterWeekday
  20. Date/GregorianDaysBeforeWeekday
  21. Date/GregorianDiffDate
  22. Date/GregorianDiffDateRange
  23. Date/GregorianEaster
  24. Date/GregorianLastMonthDay
  25. Date/GregorianLeapYear
  26. Date/GregorianMonthDays
  27. Date/GregorianMoonAge
  28. Date/GregorianMoonPhase
  29. Date/GregorianRangeDiff
  30. Date/GregorianToJD
  31. Date/GregorianWeek
  32. Date/GregorianWeekday
  33. Date/GregorianWWtoDM
  34. Date/GregorianYearDays
  35. Date/GSYearToJD
  36. Date/GYearToScaliger
  37. Date/HeisDayDiff
  38. Date/HeisDaysAfterWeekday
  39. Date/HeisDaysBeforeWeekday
  40. Date/HeisDiffDate
  41. Date/HeisDiffDateRange
  42. Date/HeisEaster
  43. Date/HeisLastMonthDay
  44. Date/HeisLeapYear
  45. Date/HeisMonthDays
  46. Date/HeisRangeDiff
  47. Date/HeisToJD
  48. Date/HeisWeek
  49. Date/HeisWeekday
  50. Date/HeisWWtoDM
  51. Date/HeisYearDays
  52. Date/HSYearToJD
  53. Date/HYearToScaliger
  54. Date/JDToDate
  55. Date/JDToGregorian
  56. Date/JDToHeis
  57. Date/JDToJulian
  58. Date/JDtoMJD
  59. Date/JDToTime
  60. Date/JSYearToJD
  61. Date/JulianDayDiff
  62. Date/JulianDaysAfterWeekday
  63. Date/JulianDaysBeforeWeekday
  64. Date/JulianDiffDate
  65. Date/JulianDiffDateRange
  66. Date/JulianEaster
  67. Date/JulianLastMonthDay
  68. Date/JulianLeapYear
  69. Date/JulianMonthDays
  70. Date/JulianRangeDiff
  71. Date/JulianToJD
  72. Date/JulianWeek
  73. Date/JulianWeekday
  74. Date/JulianWWtoDM
  75. Date/JulianYearDays
  76. Date/JYearToScaliger
  77. Date/LastMonthDay
  78. Date/LeapYear
  79. Date/LMT
  80. Date/LocalToGMT
  81. Date/MJDtoJD
  82. Date/MonthDays
  83. Date/MonthShortText
  84. Date/MonthText
  85. Date/NextValidDate
  86. Date/NextValidGregorianDate
  87. Date/NextValidHeisDate
  88. Date/NextValidJulianDate
  89. Date/NumToDate
  90. Date/NumToTime
  91. Date/ParseDate
  92. Date/ParseTime
  93. Date/PreviousValidDate
  94. Date/PreviousValidGregorianDate
  95. Date/PreviousValidHeisDate
  96. Date/PreviousValidJulianDate
  97. Date/RangeDiff
  98. Date/ScaligerYearToG
  99. Date/ScaligerYearToH
  100. Date/ScaligerYearToJ
  101. Date/ScaligerYearToYear
  102. Date/SecToTime
  103. Date/SetCountry
  104. Date/SetFirstWeekday
  105. Date/SupplementCentury
  106. Date/SYearToJD
  107. Date/TimeDiff
  108. Date/TimeToJD
  109. Date/TimeToNum
  110. Date/TimeToSec
  111. Date/TimeZoneFactor
  112. Date/ValidDate
  113. Date/ValidGregorianDate
  114. Date/ValidHeisDate
  115. Date/ValidJulianDate
  116. Date/ValidTime
  117. Date/Week
  118. Date/Weekday
  119. Date/WeekdayShortText
  120. Date/WeekdayText
  121. Date/WWtoDM
  122. Date/YearDays
  123. Date/YearToScaliger
  124. Date/--background--                       Date/--background--
  125.  
  126.    NAME
  127.     Date -- This module was designed in helping calc.calendar dates (V33)
  128.  
  129.    FUNCTION
  130.     This module has been designed to become a useful and portable library
  131.     and to help developers calculate calendar dates!
  132.  
  133.    NOTES
  134.     A tropical year is 365.2422 days! / 365d, 5h, 48min, 46sec
  135.     A moon month is 29.53059 days! / 29d, 12h, 44min, 2.9 sec
  136.     A moon phase is 7.38265 days!
  137.     The calculations are historical and NOT astronomical!
  138.  
  139. Date/Compare2Dates                        Date/Compare2Dates
  140.  
  141.    NAME
  142.     Compare2Dates -- Compares date1 with date2. (V33.100)
  143.  
  144.    SYNOPSIS
  145.     compare = date_Compare2Dates(day1,month1,year1,day2,month2,year2);
  146.       d0                  d0    d1      d2    d3    d4    d5
  147.  
  148.     short date_Compare2Dates(const unsigned short day1,
  149.         const unsigned short month1, const long year1,
  150.         const unsigned short day2, const unsigned short month2,
  151.         const long year2);
  152.  
  153.    FUNCTION
  154.     Compare2Dates compares date1 with date2.
  155.  
  156.    INPUTS
  157.     day1   - day of the first date
  158.     month1 - month of the first date
  159.     year1  - year of the first date
  160.     day2   - day of the second date
  161.     month2 - month of the second month
  162.     year2  - year of the second date
  163.  
  164.    RESULT
  165.     compare - -1 : date1 < date2
  166.            0 : date1 = date2
  167.            1 : date1 > date2
  168.  
  169.    EXAMPLE
  170.     ...
  171.     if (date_Compare2Dates(18,9,1970,22,1,1994) == -1)
  172.      {
  173.       printf("<\n");
  174.      }
  175.     else
  176.      {
  177.       printf(">=\n");
  178.      }
  179.     ...
  180.  
  181.    NOTES
  182.     It is better only to use this function for years from 8 to 8000!
  183.     There is no need for different versions for Julian, Gregorian and
  184.     Heis dates!
  185.  
  186.    BUGS
  187.     There is no check if the dates are valid!
  188.  
  189.    SEE ALSO
  190.     Compare2Times()
  191.  
  192. Date/Compare2Times                        Date/Compare2Times
  193.  
  194.    NAME
  195.     Compare2Times -- Compares time1 with time2. (V33.100)
  196.  
  197.    SYNOPSIS
  198.     compare = time_Compare2Times(hour1,min1,sec1,hour2,min2,sec2);
  199.       d0                  d0    d1     d2   d3    d4     d5
  200.  
  201.     short time_Compare2Times(const unsigned short hour1,
  202.         const unsigned short min1, const unsigned short sec1,
  203.         const unsigned short hour2, const unsigned short min2,
  204.         const unsigned short sec2);
  205.  
  206.    FUNCTION
  207.     Compare2Times compares time1 with time2 (24h format only).
  208.  
  209.    INPUTS
  210.     hour1 - Hour of the first time.
  211.     min1  - Minute of the first time.
  212.     sec1  - Second of the first time.
  213.     hour2 - Hour of the second time.
  214.     min2  - Minute of the second time.
  215.     sec2  - Second of the second time.
  216.  
  217.    RESULT
  218.     compare - -1 : time1 < time2
  219.            0 : time1 = time2
  220.            1 : time1 > time2
  221.  
  222.    EXAMPLE
  223.     ...
  224.     if (time_Compare2Times(13,10,0,9,0,0) == -1)
  225.       printf("<\n");
  226.     else
  227.       printf(">=\n");
  228.     ...
  229.  
  230.    NOTES
  231.     This compares two times of 24h format!
  232.  
  233.    BUGS
  234.     There is no check if the times are valid times!
  235.  
  236.    SEE ALSO
  237.     Compare2Dates()
  238.  
  239. Date/DateText                             Date/DateText
  240.  
  241.    NAME
  242.     DateText -- Get a date text string. (V33.130)
  243.  
  244.    SYNOPSIS
  245.     date_DateText(dt,text,lang,wc);
  246.               d0  a0   d1  d2
  247.  
  248.     void date_DateText(const date_DateTexts dt, char *const text,
  249.         const date_Languages lang, const date_WordClass wc);
  250.  
  251.    FUNCTION
  252.     This function gets a date specified text in each supported language
  253.  
  254.    INPUTS
  255.     dt     - The text you want.
  256.     text   - Pointer to a string to fill in the text.
  257.     lang   - Language for which you want the text.
  258.     wc     - singular   : The singular form is given.
  259.          plural     : The plural form is given (if available).
  260.          periodical : The periodical form is given (if available).
  261.  
  262.    RESULT
  263.     None
  264.  
  265.    EXAMPLE
  266.     ...
  267.     char txt[20];
  268.     ...
  269.     date_DateText(day,&txt,English,date_SINGULAR);
  270.     ...
  271.  
  272.    NOTES
  273.     Languages:
  274.     Locale      : This is an Amiga >= OS2.1 only feature, for <= OS2.0
  275.             and other systems it will return English text!
  276.  
  277.     Available strings:
  278.     day,month,year,week,weekday,hour,minute,second,yesterday,today,
  279.     tomorrow
  280.  
  281.     There is no plural form available for: yesterday,today,tomorrow
  282.     There is no periodical form available for: yesterday,today,tomorrow,
  283.     weekday
  284.  
  285.    BUGS
  286.     In this version there is no check, if there is enough space in
  287.     text!
  288.  
  289.    SEE ALSO
  290.     WeekdayText(),WeekdayShortText(),MonthText(),MonthShortText()
  291.  
  292. Date/DateToJD                             Date/DateToJD
  293.  
  294.    NAME
  295.     DateToJD -- Returns the JD for a date. (V33.310)
  296.  
  297.    SYNOPSIS
  298.     jd = date_DateToJD(day,month,year,calendar);
  299.     d0               d0   d1    d2    d3
  300.  
  301.     unsigned long date_DateToJD(const unsigned short day,
  302.         const unsigned short month, const long year,
  303.         const date_Calendars calendar);
  304.  
  305.    FUNCTION
  306.     Returns the JD for a  date.
  307.  
  308.    INPUTS
  309.     day     - day of the date to convert
  310.     month     - month of the date to convert
  311.     year     - year of the date to convert
  312.     calendar - Calendar system to use
  313.  
  314.    RESULT
  315.     jd - This is the JD
  316.  
  317.    EXAMPLE
  318.     ...
  319.     jd = date_DateToJD(23,1,1994,date_Gregorian);
  320.     ...
  321.  
  322.    NOTES
  323.     It is better to use this function only from 8 to 8000!
  324.  
  325.    BUGS
  326.     unknown.
  327.  
  328.    SEE ALSO
  329.     JulianToJD(),GregorianToJD(),HeisToJD()
  330.  
  331. Date/DateToNum                         Date/DateToNum
  332.  
  333.    NAME
  334.     DateToNum -- Returns the date in a numeric format. (V33.250)
  335.  
  336.    SYNOPSIS
  337.     num = date_DateToNum(day,month,year);
  338.     d0             d0   d1    d2
  339.  
  340.     long date_DateToNum(const unsigned short day,
  341.         const unsigned short month, const long year);
  342.  
  343.    FUNCTION
  344.     Returns the date in a numeric format:
  345.     (year*100+month)*100+day
  346.  
  347.    INPUTS
  348.     day     - day of the date to convert
  349.     month     - month of the date to convert
  350.     year     - year of the date to convert
  351.  
  352.    RESULT
  353.     num - Date in numeric format.
  354.  
  355.    EXAMPLE
  356.     ...
  357.     num = date_DateToNum(28,6,1997);
  358.     ...
  359.  
  360.    NOTES
  361.     Negative years will be handled correctly.
  362.  
  363.    BUGS
  364.     None.
  365.  
  366.    SEE ALSO
  367.     NumToDate()
  368.  
  369. Date/DayDiff                              Date/DayDiff
  370.  
  371.    NAME
  372.     DayDiff -- Calculates the days between 2 dates. (V33.310)
  373.  
  374.    SYNOPSIS
  375.     days = date_DayDiff(day1,month1,year1,day2,month2,year2,calendar);
  376.      d0             d0    d1      d2    d3    d4    d5    d6
  377.  
  378.     long date_DayDiff(const unsigned short day1,
  379.         unsigned short month1, long year1, const unsigned short day2,
  380.         unsigned short month2, long year2, const date_Calendars calendar);
  381.  
  382.    FUNCTION
  383.     DayDiff gives you back the number of days between
  384.     two specified dates.
  385.  
  386.    INPUTS
  387.     day1     - day of the first date
  388.     month1   - month of the first date
  389.     year1    - year of the first date
  390.     day2     - day of the second date
  391.     month2   - month of the second month
  392.     year2    - year of the second date
  393.     calendar - Calendar system to use
  394.  
  395.    RESULT
  396.     days - The number of days between the two dates
  397.         (positive if date1 <= date2).
  398.  
  399.    EXAMPLE
  400.     long days;
  401.     ...
  402.     days = date_DayDiff(18,9,1970,22,1,1994,date_Gregorian);
  403.     printf("Age of Kai Hofmann in days : %ld\n",days);
  404.     ...
  405.  
  406.    NOTES
  407.     It is better only to use this function for years from 8 to 02.3200!
  408.  
  409.    BUGS
  410.     If you use one of the dates 5.10.1582 to 14.10.1582 you will get an
  411.     incorrect output because these days don't exist!
  412.  
  413.    SEE ALSO
  414.     JulianDayDiff(),GregorianDayDiff(),HeisDayDiff()
  415.  
  416. Date/DaysAfterWeekday                     Date/DaysAfterWeekday
  417.  
  418.    NAME
  419.     DaysAfterWeekday -- Returns the diff to wday after. (V33.310)
  420.  
  421.    SYNOPSIS
  422.     days = date_DaysAfterWeekday(day,month,year,weekday,calendar);
  423.      d0                 d0   d1     d2    d3   d4
  424.  
  425.     unsigned short date_DaysAfterWeekday(const unsigned short day,
  426.         const unsigned short month, const long year,
  427.         const date_Weekdays weekday, const date_Calendars calendar);
  428.  
  429.    FUNCTION
  430.     Returns the days to the weekday after the specified date.
  431.  
  432.    INPUTS
  433.     day     - day of the date
  434.     month     - month of the date
  435.     year     - year of the date
  436.     weekday  - weekday to search for building difference
  437.     calendar - Calendar system to use
  438.  
  439.    RESULT
  440.     days - The days after to the searched weekday.
  441.  
  442.    EXAMPLE
  443.     ...
  444.     days = date_DaysAfterWeekday(22,1,1994,date_Thursday,date_Gregorian);
  445.     ...
  446.  
  447.    NOTES
  448.     It is better to use this function only from 8 to 3200!
  449.  
  450.    BUGS
  451.     See Weekday()!
  452.  
  453.    SEE ALSO
  454.     JulianDaysAfterWeekday(),GregorianDaysAfterWeekday(),
  455.     HeisDaysAfterWeekday()
  456.  
  457. Date/DaysBeforeWeekday                 Date/DaysBeforeWeekday
  458.  
  459.    NAME
  460.     DaysBeforeWeekday -- Returns the diff to wday before. (V33.310)
  461.  
  462.    SYNOPSIS
  463.     days = date_DaysBeforeWeekday(day,month,year,weekday,calendar);
  464.      d0                   d0  d1      d2    d3     d4
  465.  
  466.     unsigned short date_DaysBeforeWeekday(const unsigned short day,
  467.         const unsigned short month, const long year,
  468.         const date_Weekdays weekday, const date_Calendars calendar);
  469.  
  470.    FUNCTION
  471.     Returns the days to the weekday before the specified date.
  472.  
  473.    INPUTS
  474.     day     - day of the date
  475.     month     - month of the date
  476.     year     - year of the date
  477.     weekday  - weekday to search for building difference
  478.     calendar - Calendar system to use
  479.  
  480.    RESULT
  481.     days - The days gets you back to the searched weekday (1-7)
  482.         If you get back an 8, an error occurs!
  483.  
  484.    EXAMPLE
  485.     ...
  486.     days = date_DaysBeforeWeekday(22,1,1994,date_Thursday,date_Gregorian);
  487.     ...
  488.  
  489.    NOTES
  490.     It is better to use this function only from 8 to 3200!
  491.  
  492.    BUGS
  493.     See Weekday()!
  494.  
  495.    SEE ALSO
  496.     JulianDaysBeforeWeekday(),GregorianDaysBeforeWeekday(),
  497.     HeisDaysBeforeWeekday()
  498.  
  499. Date/DiffDateRange                        Date/DiffDateRange
  500.  
  501.    NAME
  502.     DiffDateRange -- Calc new date from old one. (V33.310)
  503.  
  504.    SYNOPSIS
  505.     date_DiffDateRange(day,month,year,days,months,
  506.         years,dday,dmonth,dyear,calendar);
  507.                 d0   d1   d2   d3      d4
  508.          d5    a0     a1    a2     d6
  509.  
  510.     void date_DiffDateRange(const unsigned short day,
  511.         const unsigned short month, const long year, long days,
  512.         long months, long years, unsigned short *const dday,
  513.         unsigned short *const dmonth, long *const dyear,
  514.         const date_Calendars calendar);
  515.  
  516.     void date_DiffDateRange(const unsigned short day,
  517.         const unsigned short month, const long year, long days,
  518.         long months, long years, unsigned short &dday,
  519.         unsigned short &dmonth, long &dyear,
  520.         const date_Calendars calendar);
  521.  
  522.    FUNCTION
  523.     Returns the date which lies diffrange before/after the specified date.
  524.  
  525.    INPUTS
  526.     day      - day of the date
  527.     month    - month of the date
  528.     year     - year of the date
  529.     days     - difference to the date in days
  530.     months   - difference to the date in months
  531.     years    - difference to the date in years
  532.     calendar - Calendar system to use
  533.  
  534.    RESULT
  535.     dday   - Destination day
  536.     dmonth - Destination month
  537.     dyear  - Destination year
  538.  
  539.    EXAMPLE
  540.     ...
  541.     date_DiffDateRange(23,1,1994,0,0,1,&dday,&dmonth,&dyear,date_Gregorian);
  542.     ...
  543.  
  544.    NOTES
  545.     It is better to use this function only from 8 to 3200!
  546.  
  547.    BUGS
  548.     unknown.
  549.  
  550.    SEE ALSO
  551.     RangeDiff(),JulianDiffDateRange(),GregorianDiffDateRange(),
  552.     HeisDiffDateRange()
  553.  
  554. Date/DiffTime                             Date/DiffTime
  555.  
  556.    NAME
  557.     DiffTime -- Returns the diff. time to another time. (V33)
  558.  
  559.    SYNOPSIS
  560.     time_DiffTime(hour,min,sec,secs,rhour,rmin,rsec);
  561.                d0  d1  d2  d3    a0    a1   a2
  562.  
  563.     void time_DiffTime(const unsigned short hour, const unsigned short min,
  564.         const unsigned short sec, long secs, unsigned short *const rhour,
  565.         unsigned short *const rmin, unsigned short *const rsec);
  566.  
  567.     void time_DiffTime(const unsigned short hour, const unsigned short min,
  568.         const unsigned short sec, long secs, unsigned short &rhour,
  569.         unsigned short &rmin, unsigned short &rsec);
  570.  
  571.    FUNCTION
  572.     Returns the time which lies diffsecs before/after the specified time.
  573.  
  574.    INPUTS
  575.     hour     - hour
  576.     min     - minute
  577.     sec     - second
  578.     diffsecs - difference to the time in seconds
  579.  
  580.    RESULT
  581.     rhour - new hour
  582.     rmin  - new minute
  583.     rsec  - new second
  584.  
  585.    EXAMPLE
  586.     ...
  587.     time_DiffTime(12,19,0,2460,&hour,&min,&sec);
  588.     ...
  589.  
  590.    NOTES
  591.     Don't forget to convert AM/PM to 24h time!
  592.     Don't forget to convert 24h time to AM/PM time if needed!
  593.  
  594.    BUGS
  595.     No errorcheck, if you use a valid time
  596.  
  597.    SEE ALSO
  598.     TimeToSec(),SecToTime()
  599.  
  600. Date/Easter                               Date/Easter
  601.  
  602.    NAME
  603.     Easter -- Returns the date of Easter in a year (V33.310)
  604.  
  605.    SYNOPSIS
  606.     date_Easter(year,dday,dmonth,calendar);
  607.               d0   a0     a1    d1
  608.  
  609.     void date_Easter(const long year, unsigned short *const dday,
  610.         unsigned short *const dmonth, const date_Calendars calendar);
  611.  
  612.     void date_Easter(const long year, unsigned short &dday,
  613.         unsigned short &dmonth, const date_Calendars calendar);
  614.  
  615.    FUNCTION
  616.     Returns the date of Easter for a specified year.
  617.  
  618.    INPUTS
  619.     year     - Easter is calculated for this year
  620.     calendar - Calendar system to use
  621.  
  622.    RESULT
  623.     dday   - day of Easter Sunday
  624.     dmonth - month of Easter Sunday
  625.  
  626.    EXAMPLE
  627.     ...
  628.     date_Easter(1994,&dday,&dmonth,date_Gregorian);
  629.     ...
  630.  
  631.    NOTES
  632.     Use this only for 31 to 2099!
  633.  
  634.    BUGS
  635.     None.
  636.  
  637.    SEE ALSO
  638.     JulianEaster(),GregorianEaster(),HeisEaster()
  639.  
  640. Date/FormatDate                           Date/FormatDate
  641.  
  642.    NAME
  643.     FormatDate -- Formats a date string (V33.238)
  644.  
  645.    SYNOPSIS
  646.     date_FormatDate(fmt,day,month,year,lang,tstr);
  647.              a0  d0  d1    d2   d3     a1
  648.  
  649.     void date_FormatDate(const char *const fmt,
  650.        const unsigned short day, const unsigned short month,
  651.        const long year, const date_Languages lang, char *const tstr);
  652.  
  653.    FUNCTION
  654.     Formats the date into a string.
  655.  
  656.    INPUTS
  657.     fmt        - Format template string
  658.     day        - Day of the date to format
  659.     month        - Month of the date to format
  660.     year        - Year of the date to format
  661.     lang        - Language to use for strings
  662.  
  663.    RESULT
  664.     tstr    - Formatted date string
  665.  
  666.    EXAMPLE
  667.     char buffer[20];
  668.     ...
  669.     date_FormatDate("%Y-%m-%d",10,3,1997,date_Locale,buffer);
  670.     /* "1997-03-10" */
  671.     ...
  672.  
  673.    SYNTAX
  674.     Syntax of Amiga compatible % commands:
  675.     %d : Day number with leading 0s
  676.     %e : Day number with leading spaces
  677.     %m : Month number with leading 0s
  678.     %h : Abbreviated month name
  679.     %b : Abbreviated month name
  680.     %B : Month name
  681.     %y : Year using two digits with leading 0s
  682.     %Y : Year using four digits with leading 0s
  683.     %j : Julian date
  684.     %w : Weekday number
  685.     %a : Abbreviated weekday name
  686.     %A : Weekday name
  687.     %U : Week number, taking Sunday as first day of week
  688.     %W : Week number, taking Monday as first day of week
  689.     %x : Same as "%m/%d/%y"
  690.     %D : Same as "%m/%d/%y"
  691.  
  692.     Syntax of % commands:
  693.     %Ddf  : Day with leading 0s
  694.     %Ddv  : Day without leading 0s
  695.     %DDf  : Day within the year with leading 0s
  696.     %DDv  : Day within the year without leading 0s
  697.     %Dmf  : Month with leading 0s
  698.     %Dmv  : Month without leading 0s
  699.     %Dms  : Month string
  700.     %Dma  : Abbreviated month string
  701.     %Dy2f : 2-digit year with leading 0s
  702.     %Dy2v : 2-digit year without leading 0s
  703.     %Dy4f : 4-digit year with leading 0s
  704.     %Dy4v : 4-digit year without leading 0s
  705.     %Dys  : Scaliger year
  706.     %Dj   : JD date
  707.     %DJ   : MJD date
  708.     %Dwn  : Weekday number (1-7)
  709.     %Dws  : Weekday string
  710.     %Dwa  : Abbreviated weekday string
  711.     %DWf  : Weeknumber with leading 0s
  712.     %DWv  : Weeknumber without leading 0s
  713.     %DMf  : Age of the moon (0-30 ?) with leading 0s
  714.     %DMv  : Age of the moon (0-30 ?) without leading 0s
  715.  
  716.    NOTES
  717.     None.
  718.  
  719.    BUGS
  720.     No errorcheck, if you use a valid date, no check if tstr is big
  721.     enough.
  722.     Using something like "%a %W %Y" as fmt might result in a wrong
  723.     output year if used for the first/last week of a year.
  724.     Example:
  725.     1996-12-30 results into "Mo 1 1996" instead of 1997!
  726.  
  727.    SEE ALSO
  728.     ParseDate()
  729.  
  730. Date/FormatTime                           Date/FormatTime
  731.  
  732.    NAME
  733.     FormatTime -- Formats a time string (V33.224)
  734.  
  735.    SYNOPSIS
  736.     time_FormatTime(fmt,ChangeDay,ChangeHour,DST,hour,min,sec,
  737.        zonemin,tstr);
  738.              a0    d0       d1     d2   d3   d4  d5
  739.          d6     a1
  740.  
  741.     void time_FormatTime(const char *const fmt,
  742.        const enum time_ChangeDay ChangeDay,
  743.        const unsigned short ChangeHour, const bool DST,
  744.        const unsigned short hour,  const unsigned short min,
  745.        const unsigned short sec,  const short zonemin,
  746.        char *const tstr);
  747.  
  748.    FUNCTION
  749.     Formats the time into a string.
  750.  
  751.    INPUTS
  752.     fmt        - Format template string
  753.     ChangeDay    - Normal day, winter to summer or summer to winter
  754.               time change day.
  755.     ChangeHour    - Hour of summer/winter time change
  756.     DST        - Daylight saving status
  757.     hour        - Hour of the time to format
  758.     min        - Minute of the time to format
  759.     sec        - Second of the time to format
  760.     zonemin     - Time that was added to GMT time to get the local
  761.               time zone (in minutes -779 to +779)
  762.  
  763.    RESULT
  764.     tstr    - Formatted time string
  765.  
  766.    EXAMPLE
  767.     char buffer[20];
  768.     ...
  769.     time_FormatTime("%H:%M:%S",time_Normal,2,0,14,57,0,-360,
  770.     buffer); /* "14:57:0" */
  771.     ...
  772.  
  773.    SYNTAX
  774.     Syntax of Amiga compatible % commands:
  775.     %q : Hour using 24-hour style
  776.     %H : Hour using 24-hour style with leading 0s
  777.     %Q : Hour using 12-hour style
  778.     %I : Hour using 12-hour style with leading 0s
  779.     %p : AM or PM strings
  780.     %M : The number of minutes with leading 0s
  781.     %S : Number of seconds with leadings 0s
  782.     %R : Same as "%H:%M"
  783.     %X : Same as "%H:%M:%S"
  784.     %T : Same as "%H:%M:%S"
  785.     %r : Same as "%I:%M:%S %p"
  786.  
  787.     Syntax of % commands:
  788.     %Th1f  : 12 with leading 0s
  789.     %Th1v  : 12 without leading 0s
  790.     %Th2f  : 24 with leading 0s
  791.     %Th2v  : 24 without leading 0s
  792.     %Tpso  : a/p
  793.     %Tpsu  : A/P
  794.     %Tplo  : am/pm
  795.     %Tplu  : AM/PM
  796.     %Tmf   : with leading 0s
  797.     %Tmv   : without leading 0s
  798.     %Tsf   : with leading 0s
  799.     %Tsv   : without leading 0s
  800.     %Tj.   : starting with '.'
  801.     %Tj,   : starting with ','
  802.     %Tj0   : starting with '0.'
  803.     %Tj1   : starting with '0,'
  804.  
  805.     %Tzh?? : hours only
  806.     %Tzm?  : 0100
  807.     %TzM?? : 01:00
  808.     %Tz?z? : Use Z     for UTC
  809.     %Tz?0? : Use +00 for UTC
  810.     %Tz??f : use leading 0s
  811.     %Tz??v : do not use leading 0s
  812.  
  813.     %Tc1   : Use DST for s->w switch
  814.     %Tc2   : Use I/II for s->w switch
  815.     %Tc3   : Use a/b for s->w switch (24h only) - on 12h falls back to 2
  816.  
  817.    NOTES
  818.     None.
  819.  
  820.    BUGS
  821.     No errorcheck, if you use a valid time, no check if tstr is big
  822.     enough.
  823.  
  824.    SEE ALSO
  825.     ParseTime()
  826.  
  827. Date/GMTToLocal                           Date/GMTToLocal
  828.  
  829.    NAME
  830.     GMTToLocal -- Converts a GMT time to a locale one (V33.300)
  831.  
  832.    SYNOPSIS
  833.     datetime_GMTToLocal(gjd,gsecs,zonemin,ChangePrevDay,ChangeDay,
  834.         ChangeNextDay,ChangeHour,ljd,lsecs,DST);
  835.                  d0   d1    d2       d3           d4
  836.           d5         d6      a0    a1  a2
  837.  
  838.     void datetime_GMTToLocal(const unsigned long gjd,
  839.         const unsigned long gsecs, const short zonemin,
  840.         const time_ChangeDay ChangePrevDay,
  841.         const time_ChangeDay ChangeDay,
  842.         const time_ChangeDay ChangeNextDay,
  843.         const unsigned short ChangeHour, unsigned long *const ljd,
  844.         unsigned long *const lsecs, bool *const DST);
  845.  
  846.     void datetime_GMTToLocal(const unsigned long gjd,
  847.         const unsigned long gsecs, const short zonemin,
  848.         const time_ChangeDay ChangePrevDay,
  849.         const time_ChangeDay ChangeDay,
  850.         const time_ChangeDay ChangeNextDay,
  851.         const unsigned short ChangeHour, unsigned long &ljd,
  852.         unsigned long &lsecs, bool &DST);
  853.  
  854.    FUNCTION
  855.     Converts a GMT date/time pair into a local date/time pair.
  856.     The conversion considers the local daylight savings time as well as
  857.     the time change from winter to summer and vice versa (if any).
  858.  
  859.    INPUTS
  860.     gjd          - GMT Julian Date
  861.     gsecs          - GMT time in seconds
  862.     zonemin       - Time that was added to GMT time to get the local time
  863.             zone (in minutes -779 to +779)
  864.     ChangePrevDay - Normal day, winter to summer or summer to winter time
  865.             change on the previous day
  866.     ChangeDay     - Normal day, winter to summer or summer to winter time
  867.             change day
  868.     ChangeNextDay - Normal day, winter to summer or summer to winter time
  869.             change on the next day
  870.     ChangeHour    - Hour of summer/winter time change
  871.     DST          - Daylight saving status
  872.  
  873.    RESULT
  874.     DST   - Daylight saving status
  875.     ljd   - Local Julian Date
  876.     lsecs - Local time in seconds
  877.  
  878.    EXAMPLE
  879.     unsigned long ljd,lsecs;
  880.     bool DST = true;
  881.     ...
  882.     datetime_GMTToLocal(2450919,30300,+60,time_Normal,time_Normal,
  883.         time_Normal,2,&ljd,&lsecs,&DST);
  884.     ...
  885.  
  886.    NOTES
  887.     None.
  888.  
  889.    BUGS
  890.     No errorcheck, if you use a valid date/time.
  891.  
  892.    SEE ALSO
  893.     LocalToGMT(), JulianToJD(), GregorianToJD(), HeisToJD(),
  894.     JDToJulian(), JDToGregorian(), JDToHeis(), TimeToSec(), SecToTime(),
  895.     TimeZoneFactor()
  896.  
  897. Date/GregorianDayDiff                     Date/GregorianDayDiff
  898.  
  899.    NAME
  900.     GregorianDayDiff -- Calculates the days between 2 dates. (V33)
  901.  
  902.    SYNOPSIS
  903.     days = date_GregorianDayDiff(day1,month1,year1,day2,month2,year2);
  904.      d0                  d0    d1      d2    d3    d4    d5
  905.  
  906.     long date_GregorianDayDiff(const unsigned short day1,
  907.         unsigned short month1, long year1, const unsigned short day2,
  908.         unsigned short month2, long year2);
  909.  
  910.    FUNCTION
  911.     GregorianDayDiff gives you back the number of days between
  912.     two specified dates.
  913.  
  914.    INPUTS
  915.     day1   - day of the first date
  916.     month1 - month of the first date
  917.     year1  - year of the first date
  918.     day2   - day of the second date
  919.     month2 - month of the second month
  920.     year2  - year of the second date
  921.  
  922.    RESULT
  923.     days - The number of days between the two dates
  924.         (positive if date1 <= date2).
  925.  
  926.    EXAMPLE
  927.     long days;
  928.     ...
  929.     days = date_GregorianDayDiff(18,9,1970,22,1,1994);
  930.     printf("Age of Kai Hofmann in days : %ld\n",days);
  931.     ...
  932.  
  933.    NOTES
  934.     It is better only to use this function for years from 8 to 02.3200!
  935.  
  936.    BUGS
  937.     If you use one of the dates 5.10.1582 to 14.10.1582 you will get an
  938.     incorrect output because these days don't exist!
  939.  
  940.    SEE ALSO
  941.     GregorianLeapYear(),GregorianMonthDays(),GregorianYearDays(),
  942.     JulianDayDiff(),HeisDayDiff()
  943.  
  944. Date/GregorianDaysAfterWeekday         Date/GregorianDaysAfterWeekday
  945.  
  946.    NAME
  947.     GregorianDaysAfterWeekday -- Returns the diff to wday after. (V33)
  948.  
  949.    SYNOPSIS
  950.     days = date_GregorianDaysAfterWeekday(day,month,year,weekday);
  951.      d0                       d0   d1     d2    d3
  952.  
  953.     unsigned short date_GregorianDaysAfterWeekday(const unsigned short day,
  954.         const unsigned short month, const long year,
  955.         const date_Weekdays weekday);
  956.  
  957.    FUNCTION
  958.     Returns the days to the weekday after the specified date.
  959.     If you specify the 22.1.1994 (Saturday) and Thursday
  960.     you get back 5!
  961.     If you specify the 22.1.1994 and Saturday you get back 0
  962.     (the same day)!
  963.  
  964.    INPUTS
  965.     day    - day of the date
  966.     month    - month of the date
  967.     year    - year of the date
  968.     weekday - weekday to search for building difference
  969.  
  970.    RESULT
  971.     days - The days after to the searched weekday.
  972.  
  973.    EXAMPLE
  974.     ...
  975.     days = date_GregorianDaysAfterWeekday(22,1,1994,Thursday);
  976.     ...
  977.  
  978.    NOTES
  979.     It is better to use this function only from 8 to 3200!
  980.  
  981.    BUGS
  982.     See GregorianWeekday()!
  983.  
  984.    SEE ALSO
  985.     GregorianWeekday(),JulianDaysAfterWeekday(),HeisDaysAfterWeekday()
  986.  
  987. Date/GregorianDaysBeforeWeekday           Date/GregorianDaysBeforeWeekday
  988.  
  989.    NAME
  990.     GregorianDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  991.  
  992.    SYNOPSIS
  993.     days = date_GregorianDaysBeforeWeekday(day,month,year,weekday);
  994.      d0                    d0  d1      d2    d3
  995.  
  996.     unsigned short date_GregorianDaysBeforeWeekday(const unsigned short day,
  997.         const unsigned short month, const long year,
  998.         const date_Weekdays weekday);
  999.  
  1000.    FUNCTION
  1001.     Returns the days to the weekday before the specified date.
  1002.     If you specify the 22.1.1994 (Saturday) and Thursday
  1003.     you get back 2!
  1004.     If you specify the 22.1.1994 and Saturday you get back 0
  1005.     (the same day)!
  1006.  
  1007.    INPUTS
  1008.     day    - day of the date
  1009.     month    - month of the date
  1010.     year    - year of the date
  1011.     weekday - weekday to search for building difference
  1012.  
  1013.    RESULT
  1014.     days - The days gets you back to the searched weekday (1-7)
  1015.         If you get back an 8 an error occurs!
  1016.  
  1017.    EXAMPLE
  1018.     ...
  1019.     days = date_GregorianDaysBeforeWeekday(22,1,1994,Thursday);
  1020.     ...
  1021.  
  1022.    NOTES
  1023.     It is better to use this function only from 8 to 3200!
  1024.  
  1025.    BUGS
  1026.     See GregorianWeekday()!
  1027.  
  1028.    SEE ALSO
  1029.     GregorianWeekday(),JulianDaysBeforeWeekday(),HeisDaysBeforeWeekday()
  1030.  
  1031. Date/GregorianDiffDate                 Date/GregorianDiffDate
  1032.  
  1033.    NAME
  1034.     GregorianDiffDate -- Returns the diff date to another date. (V33)
  1035.  
  1036.    SYNOPSIS
  1037.     date_GregorianDiffDate(day,month,year,days,dday,dmonth,dyear);
  1038.                 d0   d1   d2   d3   a0      a1    a2
  1039.  
  1040.     void date_GregorianDiffDate(const unsigned short day,
  1041.         const unsigned short month, const long year, long days,
  1042.         unsigned short *const dday, unsigned short *const dmonth,
  1043.         long *const dyear);
  1044.  
  1045.     void date_GregorianDiffDate(const unsigned short day,
  1046.         const unsigned short month, const long year, long days,
  1047.         unsigned short &dday, unsigned short &dmonth, long &dyear);
  1048.  
  1049.    FUNCTION
  1050.     Returns the date which lies days before/after the specified date.
  1051.  
  1052.    INPUTS
  1053.     day   - day of the date
  1054.     month - month of the date
  1055.     year  - year of the date
  1056.     days  - difference to the date in days
  1057.  
  1058.    RESULT
  1059.     dday   - Destination day
  1060.     dmonth - Destination month
  1061.     dyear  - Destination year
  1062.  
  1063.    EXAMPLE
  1064.     ...
  1065.     date_GregorianDiffDate(23,1,1994,7,&dday,&dmonth,&dyear);
  1066.     ...
  1067.  
  1068.    NOTES
  1069.     This function is OBSOLETE - please use GregorianDiffDateRange()
  1070.     instead!
  1071.     It is better to use this function only from 8 to 3200!
  1072.  
  1073.    BUGS
  1074.     unknown.
  1075.  
  1076.    SEE ALSO
  1077.     GregorianDayDiff(),GregorianMonthDays(),JulianDiffDate(),
  1078.     HeisDiffDate()
  1079.  
  1080. Date/GregorianDiffDateRange               Date/GregorianDiffDateRange
  1081.  
  1082.    NAME
  1083.     GregorianDiffDateRange -- Calc new date from old one. (V33.296)
  1084.  
  1085.    SYNOPSIS
  1086.     date_GregorianDiffDateRange(day,month,year,days,months,
  1087.         years,dday,dmonth,dyear);
  1088.                      d0   d1   d2   d3      d4
  1089.          d5    a0     a1    a2
  1090.  
  1091.     void date_GregorianDiffDateRange(const unsigned short day,
  1092.         const unsigned short month, const long year, long days,
  1093.         long months, long years, unsigned short *const dday,
  1094.         unsigned short *const dmonth, long *const dyear);
  1095.  
  1096.     void date_GregorianDiffDateRange(const unsigned short day,
  1097.         const unsigned short month, const long year, long days,
  1098.         long months, long years, unsigned short &dday,
  1099.         unsigned short &dmonth, long &dyear);
  1100.  
  1101.    FUNCTION
  1102.     Returns the date which lies diffrange before/after the specified date.
  1103.  
  1104.    INPUTS
  1105.     day    - day of the date
  1106.     month  - month of the date
  1107.     year   - year of the date
  1108.     days   - difference to the date in days
  1109.     months - difference to the date in months
  1110.     years  - difference to the date in years
  1111.  
  1112.    RESULT
  1113.     dday   - Destination day
  1114.     dmonth - Destination month
  1115.     dyear  - Destination year
  1116.  
  1117.    EXAMPLE
  1118.     ...
  1119.     date_GregorianDiffDateRange(23,1,1994,0,0,1,&dday,&dmonth,&dyear);
  1120.     ...
  1121.  
  1122.    NOTES
  1123.     It is better to use this function only from 8 to 3200!
  1124.  
  1125.    BUGS
  1126.     unknown.
  1127.  
  1128.    SEE ALSO
  1129.     GregorianDiffDate(),GregorianRangeDiff(),JulianDiffDateRange(),
  1130.     HeisDiffDateRange()
  1131.  
  1132. Date/GregorianEaster                      Date/GregorianEaster
  1133.  
  1134.    NAME
  1135.     GregorianEaster -- Returns the date of Easter in a year (V33)
  1136.  
  1137.    SYNOPSIS
  1138.     date_GregorianEaster(year,dday,dmonth);
  1139.                   d0   a0     a1
  1140.  
  1141.     void date_GregorianEaster(const long year, unsigned short *const dday,
  1142.         unsigned short *const dmonth);
  1143.  
  1144.     void date_GregorianEaster(const long year, unsigned short &dday,
  1145.         unsigned short &dmonth);
  1146.  
  1147.    FUNCTION
  1148.     Returns the date of Easter for a specified year.
  1149.  
  1150.    INPUTS
  1151.     year  - Easter is calculated for this year
  1152.  
  1153.    RESULT
  1154.     dday   - day of Easter Sunday
  1155.     dmonth - month of Easter Sunday
  1156.  
  1157.    EXAMPLE
  1158.     ...
  1159.     date_GregorianEaster(1994,&dday,&dmonth);
  1160.     ...
  1161.  
  1162.    NOTES
  1163.     Use this only for 31 to 2099!
  1164.  
  1165.    BUGS
  1166.     None.
  1167.  
  1168.    SEE ALSO
  1169.     JulianEaster(),HeisEaster()
  1170.  
  1171. Date/GregorianLastMonthDay                Date/GregorianLastMonthDay
  1172.  
  1173.    NAME
  1174.     GregorianLastMonthDay -- The number of last day in a month. (V33.234)
  1175.  
  1176.    SYNOPSIS
  1177.     day = date_GregorianLastMonthDay(month,year);
  1178.      d0                  d0    d1
  1179.  
  1180.     unsigned short date_GregorianLastMonthDay(const unsigned short month,
  1181.         const long year);
  1182.  
  1183.    FUNCTION
  1184.     GregorianLastMonthDay returns the number of the last day for a given
  1185.     month.
  1186.  
  1187.    INPUTS
  1188.     month - The month from which you want to get the last day.
  1189.     year  - The year in which the month is.
  1190.  
  1191.    RESULT
  1192.     days - The number of the last day the month uses, or 0 if you use
  1193.         an incorrect month.
  1194.  
  1195.    EXAMPLE
  1196.     ...
  1197.     day = date_GregorianLastMonthDay(1,1994); /* 31 */
  1198.     ...
  1199.  
  1200.    NOTES
  1201.     Use this function only for years from 8 to 3199!
  1202.  
  1203.    BUGS
  1204.     none.
  1205.  
  1206.    SEE ALSO
  1207.     GregorianMonthDays(),JulianLastMonthDay(),HeisLastMonthDay()
  1208.  
  1209. Date/GregorianLeapYear                 Date/GregorianLeapYear
  1210.  
  1211.    NAME
  1212.     GregorianLeapYear -- Checks if a year is a leap year. (V33)
  1213.  
  1214.    SYNOPSIS
  1215.     leapyear = date_GregorianLeapYear(year);
  1216.        d0                   d0
  1217.  
  1218.     bool date_GregorianLeapYear(const long year);
  1219.  
  1220.    FUNCTION
  1221.     GregorianLeapYear checks if a year is a leap year.
  1222.     For years after 1582 all years devideable by 4 are leap years,
  1223.     without years devideable by 100, but years devideable by 400
  1224.     are leap years again!
  1225.     For years before 1582 see JulianLeapYear().
  1226.  
  1227.    INPUTS
  1228.     year - The year which should be checked (from -32768 to 32767)
  1229.         I think only values from 8 to 3200 are valid, because of
  1230.         the variant that was done by Augustus!
  1231.  
  1232.    RESULT
  1233.     leapyear - true if the year is a leap year, otherwise false.
  1234.  
  1235.    EXAMPLE
  1236.     ...
  1237.     if (date_GregorianLeapYear(1994))
  1238.      {
  1239.       printf("leap year!\n");
  1240.      }
  1241.     else
  1242.      {
  1243.       printf("no leap year!\n");
  1244.      }
  1245.     ...
  1246.  
  1247.    NOTES
  1248.     A year is 365.2425 days long!
  1249.     Use this function only for values from 8 to 3199!
  1250.  
  1251.    BUGS
  1252.     No known bugs.
  1253.  
  1254.    SEE ALSO
  1255.     JulianLeapYear(),HeisLeapYear()
  1256.  
  1257. Date/GregorianMonthDays                   Date/GregorianMonthDays
  1258.  
  1259.    NAME
  1260.     GregorianMonthDays -- Returns the number of days of a month. (V33)
  1261.  
  1262.    SYNOPSIS
  1263.     days = date_GregorianMonthDays(month,year);
  1264.      d0                d0    d1
  1265.  
  1266.     unsigned short date_GregorianMonthDays(const unsigned short month,
  1267.         const long year);
  1268.  
  1269.    FUNCTION
  1270.     GregorianMonthDays returns the number of days a month in
  1271.     a specified year has.
  1272.     For the year 1582 and the month 10 there are only 21 days,
  1273.     because of the Gregorian-reform 10 days are deleted from
  1274.     the month (for more - look out for books about this!)
  1275.  
  1276.    INPUTS
  1277.     month - The month from which you want to get the number of days.
  1278.     year  - The year in which the month is.
  1279.  
  1280.    RESULT
  1281.     days - The number of days the month uses, or 0 if you use
  1282.         an incorrect month.
  1283.  
  1284.    EXAMPLE
  1285.     unsigned short days;
  1286.     ...
  1287.     days = date_GregorianMonthDays(1,1994);
  1288.     printf("Days of January 1994 : %hu\n",days);
  1289.     ...
  1290.  
  1291.    NOTES
  1292.     Use this function only for years from 8 to 3199!
  1293.  
  1294.    BUGS
  1295.     none.
  1296.  
  1297.    SEE ALSO
  1298.     GregorianLeapYear(),JulianMonthDays(),HeisMonthDays()
  1299.  
  1300. Date/GregorianMoonAge                     Date/GregorianMoonAge
  1301.  
  1302.    NAME
  1303.     GregorianMoonAge -- Returns the age of the moon (V33)
  1304.  
  1305.    SYNOPSIS
  1306.     ep = date_GregorianMoonAge(day,month,year);
  1307.     d0                d0     d1   d2
  1308.  
  1309.     unsigned short date_GregorianMoonAge(const unsigned short day,
  1310.         const unsigned short month, const long year);
  1311.  
  1312.    FUNCTION
  1313.     Returns the age of the moon on a specified date.
  1314.  
  1315.    INPUTS
  1316.     day   - For this day the age is calculated.
  1317.     month - For this month the age is calculated.
  1318.     year  - For this year the age is calculated.
  1319.  
  1320.    RESULT
  1321.     ep - The age of the moon on the specified date.
  1322.  
  1323.    EXAMPLE
  1324.     ...
  1325.     ep = date_GregorianMoonAge(18,9,1994);
  1326.     ...
  1327.  
  1328.    NOTES
  1329.     Use this only for 1582 to 4100!
  1330.     This is only an experimental version!
  1331.  
  1332.    BUGS
  1333.     unknown.
  1334.  
  1335.    SEE ALSO
  1336.     MoonMonthAge(),GregorianEP(),GregorianMoonPhase()
  1337.  
  1338. Date/GregorianMoonPhase                   Date/GregorianMoonPhase
  1339.  
  1340.    NAME
  1341.     GregorianMoonPhase -- Searches for the next moon phase (V33.098)
  1342.  
  1343.    SYNOPSIS
  1344.     jd = date_GregorianMoonPhase(day,month,year,phase);
  1345.     d0                 d0   d1    d2   d3
  1346.  
  1347.     unsigned long date_GregorianMoonPhase(const unsigned short day,
  1348.         const unsigned short month, const long year,
  1349.         const MoonPhases phase);
  1350.  
  1351.    FUNCTION
  1352.     Returns the next moon phase you are searching for after
  1353.     a specified date.
  1354.  
  1355.    INPUTS
  1356.     day   - Start day for the search.
  1357.     month - Start month for the search.
  1358.     year  - Start year for the search.
  1359.     phase - The moon phase you want to know.
  1360.  
  1361.    RESULT
  1362.     jd - The day (as JD) on which the moon phase was found.
  1363.  
  1364.    EXAMPLE
  1365.     ...
  1366.     jd = date_GregorianMoonPhase(18,9,1994,FullMoon);
  1367.     date_JDToGregorian(jd,&day,&month,&year);
  1368.     ...
  1369.  
  1370.    NOTES
  1371.     The range of this function is unknown to me!
  1372.     So use it only from 1583 to 2500.
  1373.     This is only an experimental version!
  1374.  
  1375.    BUGS
  1376.     unknown.
  1377.  
  1378.    SEE ALSO
  1379.     MoonMonthAge()
  1380.  
  1381. Date/GregorianRangeDiff                   Date/GregorianRangeDiff
  1382.  
  1383.    NAME
  1384.     GregorianRangeDiff -- Calculates the range between 2 dates. (V33.297)
  1385.  
  1386.    SYNOPSIS
  1387.     date_GregorianRangeDiff(day1,month1,year1,day2,month2,year2,days,
  1388.         months,years);
  1389.                  d0    d1    d2    d3     d4    d5    a0
  1390.           a1     a2
  1391.  
  1392.     void date_GregorianRangeDiff(unsigned short day1,
  1393.         unsigned short month1, long year1, unsigned short day2,
  1394.         unsigned short month2, long year2, short *const days,
  1395.         short *const months, long *const years);
  1396.  
  1397.     void date_GregorianRangeDiff(unsigned short day1,
  1398.         unsigned short month1, long year1, unsigned short day2,
  1399.         unsigned short month2, long year2, short &days, short &months,
  1400.         long &years);
  1401.  
  1402.    FUNCTION
  1403.     GregorianRangeDiff gives you back the number of days, months and
  1404.     years between two specified dates.
  1405.  
  1406.    INPUTS
  1407.     day1   - day of the first date
  1408.     month1 - month of the first date
  1409.     year1  - year of the first date
  1410.     day2   - day of the second date
  1411.     month2 - month of the second month
  1412.     year2  - year of the second date
  1413.  
  1414.    RESULT
  1415.     days   - The number of days between the two dates
  1416.          (positive if date1 <= date2).
  1417.     months - The number of months between the two dates
  1418.          (positive if date1 <= date2).
  1419.     years  - The number of years between the two dates
  1420.          (positive if date1 <= date2).
  1421.  
  1422.    EXAMPLE
  1423.     short days,months;
  1424.     long years;
  1425.     ...
  1426.     date_GregorianRangeDiff(18,9,1970,25,1,1998,&days,&months,&years);
  1427.     printf("Age of Kai Hofmann is : %ld years, %hd months, %hd days\n",
  1428.        years,months,days);
  1429.     ...
  1430.  
  1431.    NOTES
  1432.     It is better only to use this function for years from 8 to 02.3200!
  1433.  
  1434.    BUGS
  1435.     If you use one of the dates 5.10.1582 to 14.10.1582 you will get an
  1436.     incorrect output because these days don't exist!
  1437.  
  1438.    SEE ALSO
  1439.     GregorianDayDiff(),GregorianDiffDateRange(),JulianRangeDiff(),
  1440.     HeisRangeDiff()
  1441.  
  1442. Date/GregorianToJD                        Date/GregorianToJD
  1443.  
  1444.    NAME
  1445.     GregorianToJD -- Returns the JD for a date. (V33)
  1446.  
  1447.    SYNOPSIS
  1448.     jd = date_GregorianToJD(day,month,year);
  1449.     d0             d0   d1    d2
  1450.  
  1451.     unsigned long date_GregorianToJD(const unsigned short day,
  1452.         const unsigned short month, const long year);
  1453.  
  1454.    FUNCTION
  1455.     Returns the JD for a Gregorian date.
  1456.  
  1457.    INPUTS
  1458.     day     - day of the date to convert
  1459.     month     - month of the date to convert
  1460.     year     - year of the date to convert
  1461.  
  1462.    RESULT
  1463.     jd - This is the JD
  1464.  
  1465.    EXAMPLE
  1466.     ...
  1467.     jd = date_GregorianToJD(23,1,1994);
  1468.     ...
  1469.  
  1470.    NOTES
  1471.     It is better to use this function only from 8 to 3200!
  1472.  
  1473.    BUGS
  1474.     unknown.
  1475.  
  1476.    SEE ALSO
  1477.     GSYearToJD(),GYearToScaliger(),GregorianDayDiff(),JulianToJD(),
  1478.     HeisToJD()
  1479.  
  1480. Date/GregorianWeek                        Date/GregorianWeek
  1481.  
  1482.    NAME
  1483.     GregorianWeek -- Gets the weeknumber for a specified date. (V33)
  1484.  
  1485.    SYNOPSIS
  1486.     weeknr = date_GregorianWeek(day,month,year);
  1487.       d0                 d0   d1   d2
  1488.  
  1489.     unsigned short date_GregorianWeek(const unsigned short day,
  1490.         const unsigned short month, const long year);
  1491.  
  1492.    FUNCTION
  1493.     GregorianWeek gets the number of the week for a specified date.
  1494.  
  1495.    INPUTS
  1496.     day   - day of the date
  1497.     month - month of the date
  1498.     year  - year of the date
  1499.  
  1500.    RESULT
  1501.     week - This is the number of the week the specified date lies in.
  1502.         If the first day in a new year is a Friday, Saturday or
  1503.         Sunday, this would be the last week of the last year!
  1504.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  1505.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  1506.         first week of the next year!
  1507.  
  1508.    EXAMPLE
  1509.     ...
  1510.     weeknr = date_GregorianWeek(4,10,1582);
  1511.     ...
  1512.  
  1513.    NOTES
  1514.     It is better only to use this function for years from 8 to 3200!
  1515.  
  1516.    BUGS
  1517.     For years < 0 errors could occur.
  1518.  
  1519.    SEE ALSO
  1520.     JulianWeek(),HeisWeek(),GregorianWeekday(),GregorianDayDiff(),
  1521.     SetFirstWeekday()
  1522.  
  1523. Date/GregorianWeekday                     Date/GregorianWeekday
  1524.  
  1525.    NAME
  1526.     GregorianWeekday -- Gets the weekday of a specified date. (V33)
  1527.  
  1528.    SYNOPSIS
  1529.     weekday = date_GregorianWeekday(day,month,year);
  1530.       d0                 d0   d1   d2
  1531.  
  1532.     date_Weekdays date_GregorianWeekday(const unsigned short day,
  1533.         unsigned short month, long year);
  1534.  
  1535.    FUNCTION
  1536.     GregorianWeekday gets the weekday for a specified date.
  1537.  
  1538.    INPUTS
  1539.     day   - day of the date
  1540.     month - month of the date
  1541.     year  - year of the date
  1542.  
  1543.    RESULT
  1544.     weekday - This result is of type:
  1545.         date_Weekdays = {date_dayerr,date_Monday,date_Tuesday,
  1546.                  date_Wednesday,date_Thursday,date_Friday,
  1547.                  date_Saturday,date_Sunday};
  1548.         dayerr will show you, that an error occurs!
  1549.  
  1550.    EXAMPLE
  1551.     ...
  1552.     weekday = date_GregorianWeekday(22,1,1994);
  1553.     if (weekday == dayerr)
  1554.      {
  1555.       ...
  1556.      }
  1557.     ...
  1558.  
  1559.    NOTES
  1560.     It is better only to use this function for years from 8 to 3200!
  1561.     In this version dayerr will only occur for the lost days :)
  1562.  
  1563.    BUGS
  1564.     It's not possible to use years < 0 (for more see JulianWeekday()).
  1565.  
  1566.    SEE ALSO
  1567.     JulianWeekday(),HeisWeekday()
  1568.  
  1569. Date/GregorianWWtoDM                      Date/GregorianWWtoDM
  1570.  
  1571.    NAME
  1572.     GregorianWWtoDM -- Convert Weekday,Week to Day,Month. (V33.243)
  1573.  
  1574.    SYNOPSIS
  1575.     date_GregorianWWtoDM(weekday,week,year,dday,dmonth,dyear);
  1576.                 d0    d1   d2    a0    a1     a2
  1577.  
  1578.     void date_GregorianWWtoDM(const date_Weekdays weekday,
  1579.        const unsigned short week, const long year,
  1580.        unsigned short *const dday, unsigned short *const dmonth,
  1581.        long *const dyear);
  1582.  
  1583.     void date_GregorianWWtoDM(const date_Weekdays weekday,
  1584.        const unsigned short week, const long year,
  1585.        unsigned short &dday, unsigned short &dmonth,
  1586.        long &dyear);
  1587.  
  1588.    FUNCTION
  1589.     Converts weekday,week to day,month.
  1590.  
  1591.    INPUTS
  1592.     weekday  - weekday of the date to convert
  1593.     week     - week of the date to convert
  1594.     year     - year of the date to convert
  1595.  
  1596.    RESULT
  1597.     day   - day of the converted date
  1598.     month - month of the converted date
  1599.     year  - year of the converted date
  1600.  
  1601.    EXAMPLE
  1602.     unsigned short day,month;
  1603.     long year;
  1604.     ...
  1605.     date_GregorianWWtoDM(date_Thursday,14,1997,&day,&month,&year);
  1606.     /* 1997-04-03 */
  1607.     ...
  1608.  
  1609.    NOTES
  1610.     It is better to use this function only from 8 to 3200!
  1611.     Be careful, the resulting year might be different from the input
  1612.     year!
  1613.  
  1614.    BUGS
  1615.     unknown.
  1616.  
  1617.    SEE ALSO
  1618.     GregorianWWtoDM(), HeisWWtoDM()
  1619.  
  1620. Date/GregorianYearDays                 Date/GregorianYearDays
  1621.  
  1622.    NAME
  1623.     GregorianYearDays -- Gives back the number of days in a year. (V33)
  1624.  
  1625.    SYNOPSIS
  1626.     days = date_GregorianYearDays(year);
  1627.      d0                   d0
  1628.  
  1629.     unsigned short date_GregorianYearDays(const long year);
  1630.  
  1631.    FUNCTION
  1632.     GregorianYearDays gives you back the number of days in
  1633.     a specified year.
  1634.  
  1635.    INPUTS
  1636.     year  - The year in which to count the days.
  1637.  
  1638.    RESULT
  1639.     days - The number of days the year uses.
  1640.  
  1641.    EXAMPLE
  1642.     unsigned short days;
  1643.     ...
  1644.     days = date_GregorianYearDays(1994);
  1645.     printf("Days of 1994 : %hu\n",days);
  1646.     ...
  1647.  
  1648.    NOTES
  1649.     It is better only to use this function for years from 8 to 3199!
  1650.  
  1651.    BUGS
  1652.     No known bugs.
  1653.  
  1654.    SEE ALSO
  1655.     GregorianMonthDays(),JulianYearDays(),HeisYearDays()
  1656.  
  1657. Date/GSYearToJD                           Date/GSYearToJD
  1658.  
  1659.    NAME
  1660.     GSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  1661.  
  1662.    SYNOPSIS
  1663.     jd = date_GSYearToJD(syear);
  1664.     d0              d0
  1665.  
  1666.     unsigned long date_GSYearToJD(const unsigned long syear);
  1667.  
  1668.    FUNCTION
  1669.     Returns the Julianday of a Scaliger year.
  1670.  
  1671.    INPUTS
  1672.     syear      - Scaliger year
  1673.  
  1674.    RESULT
  1675.     jd - The Julianday
  1676.  
  1677.    EXAMPLE
  1678.     ...
  1679.     jd = date_GSYearToJD(4800);
  1680.     ...
  1681.  
  1682.    NOTES
  1683.     It is better to use this function only from 4707 to 7981!
  1684.  
  1685.    BUGS
  1686.     unknown.
  1687.  
  1688.    SEE ALSO
  1689.     JSYearToJD(),HSYearToJD()
  1690.  
  1691. Date/GYearToScaliger                      Date/GYearToScaliger
  1692.  
  1693.    NAME
  1694.     GYearToScaliger -- Returns the year as Scaliger year. (V33)
  1695.  
  1696.    SYNOPSIS
  1697.     syear = date_GYearToScaliger(year);
  1698.      d0                  d0
  1699.  
  1700.     unsigned long date_GYearToScaliger(const long year);
  1701.  
  1702.    FUNCTION
  1703.     Returns the Scaliger year.
  1704.  
  1705.    INPUTS
  1706.     year     - Gregorian year
  1707.  
  1708.    RESULT
  1709.     syear - The Scaliger year
  1710.  
  1711.    EXAMPLE
  1712.     ...
  1713.     syear = date_GYearToScaliger(1994);
  1714.     ...
  1715.  
  1716.    NOTES
  1717.     It is better to use this function only from 8 to 3200!
  1718.  
  1719.    BUGS
  1720.     unknown.
  1721.  
  1722.    SEE ALSO
  1723.     JYearToScaliger(),HYearToScaliger()
  1724.  
  1725. Date/HeisDayDiff                          Date/HeisDayDiff
  1726.  
  1727.    NAME
  1728.     HeisDayDiff -- Calculates the days between 2 dates. (V33)
  1729.  
  1730.    SYNOPSIS
  1731.     days = date_HeisDayDiff(day1,month1,year1,day2,month2,year2);
  1732.      d0             d0    d1    d2    d3     d4    d5
  1733.  
  1734.     long date_HeisDayDiff(const unsigned short day1, unsigned short month1,
  1735.         long year1, const unsigned short day2, unsigned short month2,
  1736.         long year2);
  1737.  
  1738.    FUNCTION
  1739.     HeisDayDiff gives you back the number of days between
  1740.     two specified dates.
  1741.  
  1742.    INPUTS
  1743.     day1   - day of the first date
  1744.     month1 - month of the first date
  1745.     year1  - year of the first date
  1746.     day2   - day of the second date
  1747.     month2 - month of the second month
  1748.     year2  - year of the second date
  1749.  
  1750.    RESULT
  1751.     days - The number of days between the two dates
  1752.         (positive if date1 <= date2).
  1753.  
  1754.    EXAMPLE
  1755.     long days;
  1756.     ...
  1757.     days = date_HeisDayDiff(18,9,1970,22,1,1994);
  1758.     printf("Age of Kai Hofmann in days : %ld\n",days);
  1759.     ...
  1760.  
  1761.    NOTES
  1762.     It is better only to use this function for years from 8 to 8000!
  1763.  
  1764.    BUGS
  1765.     If you use on of the dates 5.10.1582 to 14.10.1582 you will get an
  1766.     incorrect output because these days don't exist!
  1767.  
  1768.    SEE ALSO
  1769.     HeisLeapYear(),HeisMonthDays(),HeisYearDays(),
  1770.     JulianDayDiff(),GregorianDayDiff()
  1771.  
  1772. Date/HeisDaysAfterWeekday                 Date/HeisDaysAfterWeekday
  1773.  
  1774.    NAME
  1775.     HeisDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  1776.  
  1777.    SYNOPSIS
  1778.     days = date_HeisDaysAfterWeekday(day,month,year,weekday);
  1779.      d0                  d0   d1   d2       d3
  1780.  
  1781.     unsigned short date_HeisDaysAfterWeekday(const unsigned short day,
  1782.         const unsigned short month, const long year,
  1783.         const date_Weekdays weekday);
  1784.  
  1785.    FUNCTION
  1786.     Returns the days to the weekday after the specified date.
  1787.     If you specify the 22.1.1994 (Saturday) and Thursday
  1788.     you get back 5!
  1789.     If you specify the 22.1.1994 and Saturday you get back 0
  1790.     (the same day)!
  1791.  
  1792.    INPUTS
  1793.     day    - day of the date
  1794.     month    - month of the date
  1795.     year    - year of the date
  1796.     weekday - weekday to search for building difference
  1797.  
  1798.    RESULT
  1799.     days - The days after to the searched weekday.
  1800.  
  1801.    EXAMPLE
  1802.     ...
  1803.     days = date_HeisDaysAfterWeekday(22,1,1994,Thursday);
  1804.     ...
  1805.  
  1806.    NOTES
  1807.     It is better to use this function only from 8 to 8000!
  1808.  
  1809.    BUGS
  1810.     See HeisWeekday()!
  1811.  
  1812.    SEE ALSO
  1813.     HeisWeekday(),JulianDaysAfterWeekday(),GregorianDaysAfterWeekday()
  1814.  
  1815. Date/HeisDaysBeforeWeekday                Date/HeisDaysBeforeWeekday
  1816.  
  1817.    NAME
  1818.     HeisDaysBeforeWeekday -- Returns the diff to wday before. (V33)
  1819.  
  1820.    SYNOPSIS
  1821.     days = date_HeisDaysBeforeWeekday(day,month,year,weekday);
  1822.      d0                   d0  d1    d2    d3
  1823.  
  1824.     unsigned short date_HeisDaysBeforeWeekday(const unsigned short day,
  1825.         const unsigned short month, const long year,
  1826.         const date_Weekdays weekday);
  1827.  
  1828.    FUNCTION
  1829.     Returns the days to the weekday before the specified date.
  1830.     If you specify the 22.1.1994 (Saturday) and Thursday
  1831.     you get back 2!
  1832.     If you specify the 22.1.1994 and Saturday you get back 0
  1833.     (the same day)!
  1834.  
  1835.    INPUTS
  1836.     day    - day of the date
  1837.     month    - month of the date
  1838.     year    - year of the date
  1839.     weekday - weekday to search for building difference
  1840.  
  1841.    RESULT
  1842.     days - The days gets you back to the searched weekday (1-7)
  1843.         If you get back an 8 an error occurs!
  1844.  
  1845.    EXAMPLE
  1846.     ...
  1847.     days = date_HeisDaysBeforeWeekday(22,1,1994,Thursday);
  1848.     ...
  1849.  
  1850.    NOTES
  1851.     It is better to use this function only from 8 to 8000!
  1852.  
  1853.    BUGS
  1854.     See HeisWeekday()!
  1855.  
  1856.    SEE ALSO
  1857.     HeisWeekday(),JulianDaysBeforeWeekday(),GregorianDaysBeforeWeekday()
  1858.  
  1859. Date/HeisDiffDate                         Date/HeisDiffDate
  1860.  
  1861.    NAME
  1862.     HeisDiffDate -- Returns the date for a diff to another date. (V33)
  1863.  
  1864.    SYNOPSIS
  1865.     date_HeisDiffDate(day,month,year,days,dday,dmonth,dyear);
  1866.                d0    d1   d2   d3   a0    a1    a2
  1867.  
  1868.     void date_HeisDiffDate(const unsigned short day,
  1869.         const unsigned short month, const long year, long days,
  1870.         unsigned short *const dday, unsigned short *const dmonth,
  1871.         long *const dyear);
  1872.  
  1873.     void date_HeisDiffDate(const unsigned short day,
  1874.         const unsigned short month, const long year, long days,
  1875.         unsigned short &dday, unsigned short &dmonth, long &dyear);
  1876.  
  1877.    FUNCTION
  1878.     Returns the date which lies days before/after the specified date.
  1879.  
  1880.    INPUTS
  1881.     day   - day of the date
  1882.     month - month of the date
  1883.     year  - year of the date
  1884.     days  - difference to the date in days
  1885.  
  1886.    RESULT
  1887.     dday   - Destination day
  1888.     dmonth - Destination month
  1889.     dyear  - Destination year
  1890.  
  1891.    EXAMPLE
  1892.     ...
  1893.     date_HeisDiffDate(23,1,1994,7,&dday,&dmonth,&dyear);
  1894.     ...
  1895.  
  1896.    NOTES
  1897.     This function is OBSOLETE - please use HeisDiffDateRange()
  1898.     instead!
  1899.     It is better to use this function only from 8 to 8000!
  1900.  
  1901.    BUGS
  1902.     unknown.
  1903.  
  1904.    SEE ALSO
  1905.     HeisDayDiff(),HeisMonthDays(),JulianDiffDate(),GregorianDiffDate()
  1906.  
  1907. Date/HeisDiffDateRange                 Date/HeisDiffDateRange
  1908.  
  1909.    NAME
  1910.     HeisDiffDateRange -- Calc new date from old one and diff. (V33.296)
  1911.  
  1912.    SYNOPSIS
  1913.     date_HeisDiffDateRange(day,month,year,days,months,years,
  1914.         dday,dmonth,dyear);
  1915.                 d0   d1   d2   d3    d4     d5
  1916.          a0    a1     a2
  1917.  
  1918.     void date_HeisDiffDateRange(const unsigned short day,
  1919.         const unsigned short month, const long year, long days,
  1920.         long months, long years, unsigned short *const dday,
  1921.         unsigned short *const dmonth, long *const dyear);
  1922.  
  1923.     void date_HeisDiffDateRange(const unsigned short day,
  1924.         const unsigned short month, const long year, long days,
  1925.         long months, long years, unsigned short &dday,
  1926.         unsigned short &dmonth, long &dyear);
  1927.  
  1928.    FUNCTION
  1929.     Returns the date which lies diffrange before/after the specified date.
  1930.  
  1931.    INPUTS
  1932.     day    - day of the date
  1933.     month  - month of the date
  1934.     year   - year of the date
  1935.     days   - difference to the date in days
  1936.     months - difference to the date in months
  1937.     years  - difference to the date in years
  1938.  
  1939.    RESULT
  1940.     dday   - Destination day
  1941.     dmonth - Destination month
  1942.     dyear  - Destination year
  1943.  
  1944.    EXAMPLE
  1945.     ...
  1946.     date_HeisDiffDateRange(23,1,1994,0,0,1,&dday,&dmonth,&dyear);
  1947.     ...
  1948.  
  1949.    NOTES
  1950.     It is better to use this function only from 8 to 8000!
  1951.  
  1952.    BUGS
  1953.     unknown.
  1954.  
  1955.    SEE ALSO
  1956.     HeisDiffDate(),HeisRangeDiff(),JulianDiffDateRange(),
  1957.     GregorianDiffDateRange()
  1958.  
  1959. Date/HeisEaster                           Date/HeisEaster
  1960.  
  1961.    NAME
  1962.     HeisEaster -- Returns the date of Easter in a year (V33)
  1963.  
  1964.    SYNOPSIS
  1965.     date_HeisEaster(year,dday,dmonth);
  1966.              d0   a0    a1
  1967.  
  1968.     void date_HeisEaster(const long year, unsigned short *const dday,
  1969.         unsigned short *const dmonth);
  1970.  
  1971.     void date_HeisEaster(const long year, unsigned short &dday,
  1972.         unsigned short &dmonth);
  1973.  
  1974.    FUNCTION
  1975.     Returns the date of Easter for a specified year.
  1976.  
  1977.    INPUTS
  1978.     year  - Easter is calculated for this year
  1979.  
  1980.    RESULT
  1981.     dday   - day of Easter Sunday
  1982.     dmonth - month of Easter Sunday
  1983.  
  1984.    EXAMPLE
  1985.     ...
  1986.     date_HeisEaster(1994,&dday,&dmonth);
  1987.     ...
  1988.  
  1989.    NOTES
  1990.     This is only a dummy to date_GregorianEaster!
  1991.     Use this only for 31 to 2099!
  1992.  
  1993.    BUGS
  1994.     Unknown.
  1995.  
  1996.    SEE ALSO
  1997.     JulianEaster(),GregorianEaster()
  1998.  
  1999. Date/HeisLastMonthDay                     Date/HeisLastMonthDay
  2000.  
  2001.    NAME
  2002.     HeisLastMonthDay -- The number of last day in a month. (V33.234)
  2003.  
  2004.    SYNOPSIS
  2005.     day = date_HeisLastMonthDay(month,year);
  2006.      d0                 d0    d1
  2007.  
  2008.     unsigned short date_HeisLastMonthDay(const unsigned short month,
  2009.         const long year);
  2010.  
  2011.    FUNCTION
  2012.     HeisLastMonthDay returns the number of the last day for a given
  2013.     month.
  2014.  
  2015.    INPUTS
  2016.     month - The month from which you want to get the last day.
  2017.     year  - The year in which the month is.
  2018.  
  2019.    RESULT
  2020.     day - The number of the last day the month uses, or 0 if you use
  2021.         an incorrect month.
  2022.  
  2023.    EXAMPLE
  2024.     ...
  2025.     day = date_HeisLastMonthDays(1,1994); /* 31 */
  2026.     ...
  2027.  
  2028.    NOTES
  2029.     Use this function only for years from 8 to 8000!
  2030.  
  2031.    BUGS
  2032.     None
  2033.  
  2034.    SEE ALSO
  2035.     HeisMonthDays(),JulianLastMonthDay(),GregorianLastMonthDay()
  2036.  
  2037. Date/HeisLeapYear                         Date/HeisLeapYear
  2038.  
  2039.    NAME
  2040.     HeisLeapYear -- Checks if a year is a leap year. (V33)
  2041.  
  2042.    SYNOPSIS
  2043.     leapyear = date_HeisLeapYear(year);
  2044.        d0                  d0
  2045.  
  2046.     bool date_HeisLeapYear(const long year);
  2047.  
  2048.    FUNCTION
  2049.     HeisLeapYear checks if a year is a leap year.
  2050.     For years after 1582 see GregorianLeapYear(),
  2051.     The correction from N. Heis says, that all years devideable by
  2052.     3200 are no longer leap years!
  2053.     For years before 1582 see JulianLeapYear().
  2054.  
  2055.    INPUTS
  2056.     year - The year which should be checked (from -32768 to 32767)
  2057.         I think only values from 8 to 32767 are valid, because of
  2058.         the variant that was done by Augustus!
  2059.  
  2060.    RESULT
  2061.     leapyear - true if the year is a leap year, otherwise false.
  2062.  
  2063.    EXAMPLE
  2064.     ...
  2065.     if (date_HeisLeapYear(1994))
  2066.      {
  2067.       printf("leap year!\n");
  2068.      }
  2069.     else
  2070.      {
  2071.       printf("no leap year!\n");
  2072.      }
  2073.     ...
  2074.  
  2075.    NOTES
  2076.     A year is now 365.2421875 days!
  2077.     Use this function only for values from 8 to 8000!
  2078.  
  2079.    BUGS
  2080.     No known bugs.
  2081.  
  2082.    SEE ALSO
  2083.     JulianLeapYear(),GregorianLeapYear()
  2084.  
  2085. Date/HeisMonthDays                        Date/HeisMonthDays
  2086.  
  2087.    NAME
  2088.     HeisMonthDays -- Returns the number of days of a month. (V33)
  2089.  
  2090.    SYNOPSIS
  2091.     days = date_HeisMonthDays(month,year);
  2092.      d0               d0     d1
  2093.  
  2094.     unsigned short date_HeisMonthDays(const unsigned short month,
  2095.         const long year);
  2096.  
  2097.    FUNCTION
  2098.     HeisMonthDays returns the number of days a month in
  2099.     a specified year has.
  2100.     For the year 1582 and the month 10 there are only 21 days,
  2101.     because of the Gregorian-reform 10 days are deleted from
  2102.     the month (for more - look out for books about this!)
  2103.  
  2104.    INPUTS
  2105.     month - The month from which you want to get the number of days.
  2106.     year  - The year in which the month is.
  2107.  
  2108.    RESULT
  2109.     days - The number of days the month uses, or 0 if you use
  2110.         an incorrect month.
  2111.  
  2112.    EXAMPLE
  2113.     unsigned short days;
  2114.     ...
  2115.     days = date_HeisMonthDays(1,1994);
  2116.     printf("Days of January 1994 : %hu\n",days);
  2117.     ...
  2118.  
  2119.    NOTES
  2120.     Use this function only for years from 8 to 8000!
  2121.  
  2122.    BUGS
  2123.     See GregorianMonthDays!
  2124.  
  2125.    SEE ALSO
  2126.     HeisLeapYear(),JulianMonthDays(),GregorianMonthDays()
  2127.  
  2128. Date/HeisRangeDiff                        Date/HeisRangeDiff
  2129.  
  2130.    NAME
  2131.     HeisRangeDiff -- Calculates the range between 2 dates. (V33.297)
  2132.  
  2133.    SYNOPSIS
  2134.     date_HeisRangeDiff(day1,month1,year1,day2,month2,year2,days,months,
  2135.         years);
  2136.                 d0      d1    d2    d3    d4      d5    a0    a1
  2137.          a2
  2138.  
  2139.     void date_HeisRangeDiff(unsigned short day1,
  2140.         unsigned short month1, long year1, unsigned short day2,
  2141.         unsigned short month2, long year2, short *const days,
  2142.         short *const months, long *const years);
  2143.  
  2144.     void date_HeisRangeDiff(unsigned short day1,
  2145.         unsigned short month1, long year1, unsigned short day2,
  2146.         unsigned short month2, long year2, short &days, short &months,
  2147.         long &years);
  2148.  
  2149.    FUNCTION
  2150.     HeisRangeDiff gives you back the number of days, months and years
  2151.     between two specified dates.
  2152.  
  2153.    INPUTS
  2154.     day1   - day of the first date
  2155.     month1 - month of the first date
  2156.     year1  - year of the first date
  2157.     day2   - day of the second date
  2158.     month2 - month of the second month
  2159.     year2  - year of the second date
  2160.  
  2161.    RESULT
  2162.     days   - The number of days between the two dates
  2163.          (positive if date1 <= date2).
  2164.     months - The number of months between the two dates
  2165.          (positive if date1 <= date2).
  2166.     years  - The number of years between the two dates
  2167.          (positive if date1 <= date2).
  2168.  
  2169.    EXAMPLE
  2170.     short days,months;
  2171.     long years;
  2172.     ...
  2173.     date_HeisRangeDiff(18,9,1970,25,1,1994);
  2174.     printf("Age of Kai Hofmann is : %ld years, %hd months, %hd days\n",
  2175.        years,months,days);
  2176.     ...
  2177.  
  2178.    NOTES
  2179.     It is better only to use this function for years from 8 to 8000!
  2180.  
  2181.    BUGS
  2182.     If you use on of the dates 5.10.1582 to 14.10.1582 you will get an
  2183.     incorrect output because these days don't exist!
  2184.  
  2185.    SEE ALSO
  2186.     HeisDayDiff(),HeisDiffDateRange(),
  2187.     JulianRangeDiff(),GregorianRangeDiff()
  2188.  
  2189. Date/HeisToJD                             Date/HeisToJD
  2190.  
  2191.    NAME
  2192.     HeisToJD -- Returns the JD for a date. (V33)
  2193.  
  2194.    SYNOPSIS
  2195.     jd = date_HeisToJD(day,month,year);
  2196.     d0            d0     d1    d2
  2197.  
  2198.     unsigned long date_HeisToJD(const unsigned short day,
  2199.         const unsigned short month, const long year);
  2200.  
  2201.    FUNCTION
  2202.     Returns the JD for a Heis date.
  2203.  
  2204.    INPUTS
  2205.     day     - day of the date to convert
  2206.     month     - month of the date to convert
  2207.     year     - year of the date to convert
  2208.  
  2209.    RESULT
  2210.     jd - This is the JD
  2211.  
  2212.    EXAMPLE
  2213.     ...
  2214.     jd = date_HeisToJD(23,1,1994);
  2215.     ...
  2216.  
  2217.    NOTES
  2218.     It is better to use this function only from 8 to 3267!
  2219.  
  2220.    BUGS
  2221.     unknown.
  2222.  
  2223.    SEE ALSO
  2224.     HSYearToJD(),HYearToScaliger(),HeisDayDiff(),JulianToJD(),HeisToJD()
  2225.  
  2226. Date/HeisWeek                             Date/HeisWeek
  2227.  
  2228.    NAME
  2229.     HeisWeek -- Gets the number of the week for a specified date. (V33)
  2230.  
  2231.    SYNOPSIS
  2232.     weeknr = date_HeisWeek(day,month,year);
  2233.       d0            d0  d1      d2
  2234.  
  2235.     unsigned short date_HeisWeek(const unsigned short day,
  2236.         const unsigned short month, const long year);
  2237.  
  2238.    FUNCTION
  2239.     HeisWeek gets the number of the week for a specified date.
  2240.  
  2241.    INPUTS
  2242.     day   - day of the date
  2243.     month - month of the date
  2244.     year  - year of the date
  2245.  
  2246.    RESULT
  2247.     week - This is the number of the week the specified date lies in.
  2248.         If the first day in a new year is a Friday, Saturday or
  2249.         Sunday, this would be the last week of the last year!
  2250.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  2251.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  2252.         first week of the next year!
  2253.  
  2254.    EXAMPLE
  2255.     ...
  2256.     weeknr = date_HeisWeek(4,10,1582);
  2257.     ...
  2258.  
  2259.    NOTES
  2260.     It is better only to use this function for years from 8 to 8000!
  2261.  
  2262.    BUGS
  2263.     For years < 0 errors could occur.
  2264.  
  2265.    SEE ALSO
  2266.     JulianWeek(),GregorianWeek(),HeisWeekday(),HeisDayDiff(),
  2267.     SetFirstWeekday()
  2268.  
  2269. Date/HeisWeekday                          Date/HeisWeekday
  2270.  
  2271.    NAME
  2272.     HeisWeekday -- Gets the weekday of a specified date. (V33)
  2273.  
  2274.    SYNOPSIS
  2275.     weekday = date_HeisWeekday(day,month,year);
  2276.       d0                d0     d1   d2
  2277.  
  2278.     date_Weekdays date_HeisWeekday(const unsigned short day,
  2279.         unsigned short month, long year);
  2280.  
  2281.    FUNCTION
  2282.     HeisWeekday gets the weekday for a specified date.
  2283.  
  2284.    INPUTS
  2285.     day   - day of the date
  2286.     month - month of the date
  2287.     year  - year of the date
  2288.  
  2289.    RESULT
  2290.     weekday - This result is of type:
  2291.         date_Weekdays = {date_dayerr,date_Monday,date_Tuesday,
  2292.                  date_Wednesday,date_Thrusday,date_Friday,
  2293.                  date_Saturday,date_Sunday};
  2294.         date_dayerr will show you, that an error occurs!
  2295.  
  2296.    EXAMPLE
  2297.     ...
  2298.     weekday = date_HeisWeekday(22,1,1994);
  2299.     if (weekday == date_dayerr)
  2300.      {
  2301.       ...
  2302.      }
  2303.     ...
  2304.  
  2305.    NOTES
  2306.     It is better only to use this function for years from 8 to 8000!
  2307.     In this version date_dayerr will only occur for the lost days :)
  2308.  
  2309.    BUGS
  2310.     It is not possible to use year < 0 (see JulianWeekday() for more).
  2311.  
  2312.    SEE ALSO
  2313.     JulianWeekday(),GregorianWeekday()
  2314.  
  2315. Date/HeisWWtoDM                           Date/HeisWWtoDM
  2316.  
  2317.    NAME
  2318.     HeisWWtoDM -- Convert Weekday,Week to Day,Month. (V33.243)
  2319.  
  2320.    SYNOPSIS
  2321.     date_HeisWWtoDM(weekday,week,year,dday,dmonth,dyear);
  2322.                d0     d1   d2   a0     a1    a2
  2323.  
  2324.     void date_HeisWWtoDM(const date_Weekdays weekday,
  2325.        const unsigned short week, const long year,
  2326.        unsigned short *const dday, unsigned short *const dmonth,
  2327.        long *const dyear);
  2328.  
  2329.     void date_HeisWWtoDM(const date_Weekdays weekday,
  2330.        const unsigned short week, const long year,
  2331.        unsigned short &dday, unsigned short &dmonth,
  2332.        long &dyear);
  2333.  
  2334.    FUNCTION
  2335.     Converts weekday,week to day,month.
  2336.  
  2337.    INPUTS
  2338.     weekday  - weekday of the date to convert
  2339.     week     - week of the date to convert
  2340.     year     - year of the date to convert
  2341.  
  2342.    RESULT
  2343.     day   - day of the converted date
  2344.     month - month of the converted date
  2345.     year  - year of the converted date
  2346.  
  2347.    EXAMPLE
  2348.     unsigned short day,month;
  2349.     long year;
  2350.     ...
  2351.     date_HeisWWtoDM(date_Thursday,14,1997,&day,&month,&year);
  2352.     /* 1997-04-03 */
  2353.     ...
  2354.  
  2355.    NOTES
  2356.     It is better to use this function only from 8 to 8000!
  2357.     Be careful, the resulting year might be different from the input
  2358.     year!
  2359.  
  2360.    BUGS
  2361.     unknown.
  2362.  
  2363.    SEE ALSO
  2364.     GregorianWWtoDM(), HeisWWtoDM()
  2365.  
  2366. Date/HeisYearDays                         Date/HeisYearDays
  2367.  
  2368.    NAME
  2369.     HeisYearDays -- Gives back the number of days in a year. (V33)
  2370.  
  2371.    SYNOPSIS
  2372.     days = date_HeisYearDays(year);
  2373.      d0              d0
  2374.  
  2375.     unsigned short date_HeisYearDays(const long year);
  2376.  
  2377.    FUNCTION
  2378.     HeisYearDays gives you back the number of days in
  2379.     a specified year.
  2380.  
  2381.    INPUTS
  2382.     year  - The year in which to count the days.
  2383.  
  2384.    RESULT
  2385.     days - The number of days the year uses.
  2386.  
  2387.    EXAMPLE
  2388.     unsigned short days;
  2389.     ...
  2390.     days = date_HeisYearDays(1994);
  2391.     printf("Days of 1994 : %hu\n",days);
  2392.     ...
  2393.  
  2394.    NOTES
  2395.     It is better only to use this function for years from 8 to 8000!
  2396.  
  2397.    BUGS
  2398.     No known bugs.
  2399.  
  2400.    SEE ALSO
  2401.     HeisMonthDays(),JulianYearDays(),GregorianYearDays()
  2402.  
  2403. Date/HSYearToJD                           Date/HSYearToJD
  2404.  
  2405.    NAME
  2406.     HSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  2407.  
  2408.    SYNOPSIS
  2409.     jd = date_HSYearToJD(syear);
  2410.     d0              d0
  2411.  
  2412.     unsigned long date_HSYearToJD(const unsigned long syear);
  2413.  
  2414.    FUNCTION
  2415.     Returns the Julianday of a Scaliger year.
  2416.  
  2417.    INPUTS
  2418.     syear      - Scaliger year
  2419.  
  2420.    RESULT
  2421.     jd - The Julianday
  2422.  
  2423.    EXAMPLE
  2424.     ...
  2425.     jd = date_HSYearToJD(6700);
  2426.     ...
  2427.  
  2428.    NOTES
  2429.     It is better to use this function only from 4707 to 7981!
  2430.     In this version only date_GSYearToJD() is called, because the
  2431.     Scaliger period is only valid to 3268
  2432.  
  2433.    BUGS
  2434.     unknown.
  2435.  
  2436.    SEE ALSO
  2437.     JSYearToJD(),GSYearToJD()
  2438.  
  2439. Date/HYearToScaliger                      Date/HYearToScaliger
  2440.  
  2441.    NAME
  2442.     HYearToScaliger -- Returns the year as Scaliger year. (V33)
  2443.  
  2444.    SYNOPSIS
  2445.     syear = date_HYearToScaliger(year);
  2446.      d0                  d0
  2447.  
  2448.     unsigned long date_HYearToScaliger(const long year);
  2449.  
  2450.    FUNCTION
  2451.     Returns the Scaliger year.
  2452.  
  2453.    INPUTS
  2454.     year     - Heis year
  2455.  
  2456.    RESULT
  2457.     syear - The Scaliger year
  2458.  
  2459.    EXAMPLE
  2460.     ...
  2461.     syear = date_HYearToScaliger(1994);
  2462.     ...
  2463.  
  2464.    NOTES
  2465.     It is better to use this function only from 8 to 8000!
  2466.  
  2467.    BUGS
  2468.     The Scaliger period is defined to 3268!!!.
  2469.  
  2470.    SEE ALSO
  2471.     JYearToScaliger(),GYearToScaliger()
  2472.  
  2473. Date/JDToDate                             Date/JDToDate
  2474.  
  2475.    NAME
  2476.     JDToDate -- Returns the  date for a JD. (V33.310)
  2477.  
  2478.    SYNOPSIS
  2479.     date_JDToDate(jd,day,month,year,calendar);
  2480.               d0 a0   a1    a2    d1
  2481.  
  2482.     void date_JDToDate(const unsigned long jd, unsigned short *const day,
  2483.         unsigned short *const month, long *const year,
  2484.         const date_Calendars calendar);
  2485.  
  2486.     void date_JDToDate(const unsigned long jd, unsigned short &day,
  2487.         unsigned short &month, long &year,
  2488.         const date_Calendars calendar);
  2489.  
  2490.    FUNCTION
  2491.     Returns the  date for a JD.
  2492.  
  2493.    INPUTS
  2494.     jd     - This is the given JD.
  2495.     calendar - Calendar system to use
  2496.  
  2497.    RESULT
  2498.     day    - Day of the date.
  2499.     month    - Month of the date.
  2500.     year    - Year of the date.
  2501.  
  2502.    EXAMPLE
  2503.     ...
  2504.     date_JDToDate(2299161,&day,&month,&year,date_Gregorian);
  2505.     ...
  2506.  
  2507.    NOTES
  2508.     It is better to use this function only from 1718867 to 2889835!
  2509.  
  2510.    BUGS
  2511.     unknown.
  2512.  
  2513.    SEE ALSO
  2514.     JDToJulian(),JDToGregorian(),JDToHeis()
  2515.  
  2516. Date/JDToGregorian                        Date/JDToGregorian
  2517.  
  2518.    NAME
  2519.     JDToGregorian -- Returns the Gregorian date for a JD. (V33.095)
  2520.  
  2521.    SYNOPSIS
  2522.     date_JDToGregorian(jd,day,month,year);
  2523.                d0 a0   a1     a2
  2524.  
  2525.     void date_JDToGregorian(const unsigned long jd, unsigned short *const day,
  2526.         unsigned short *const month, long *const year);
  2527.  
  2528.     void date_JDToGregorian(const unsigned long jd, unsigned short &day,
  2529.         unsigned short &month, long &year);
  2530.  
  2531.    FUNCTION
  2532.     Returns the Gregorian date for a JD.
  2533.  
  2534.    INPUTS
  2535.     jd    - This is the given JD.
  2536.  
  2537.    RESULT
  2538.     day    - Day of the date.
  2539.     month    - Month of the date.
  2540.     year    - Year of the date.
  2541.  
  2542.    EXAMPLE
  2543.     ...
  2544.     date_JDToGregorian(2299161,&day,&month,&year);
  2545.     ...
  2546.  
  2547.    NOTES
  2548.     It is better to use this function only from 1718867 to 2889835!
  2549.  
  2550.    BUGS
  2551.     unknown.
  2552.  
  2553.    SEE ALSO
  2554.     JDToJulian(),JDToHeis()
  2555.  
  2556. Date/JDToHeis                             Date/JDToHeis
  2557.  
  2558.    NAME
  2559.     JDToHeis -- Returns the Heis date for a JD. (V33.095)
  2560.  
  2561.    SYNOPSIS
  2562.     date_JDToHeis(jd,day,month,year);
  2563.               d0 a0   a1    a2
  2564.  
  2565.     void date_JDToHeis(const unsigned long jd, unsigned short *const day,
  2566.         unsigned short *const month, long *const year);
  2567.  
  2568.     void date_JDToHeis(const unsigned long jd, unsigned short &day,
  2569.         unsigned short &month, long &year);
  2570.  
  2571.    FUNCTION
  2572.     Returns the Heis date for a JD.
  2573.  
  2574.    INPUTS
  2575.     jd    - This is the given JD.
  2576.  
  2577.    RESULT
  2578.     day    - Day of the date.
  2579.     month    - Month of the date.
  2580.     year    - Year of the date.
  2581.  
  2582.    EXAMPLE
  2583.     ...
  2584.     date_JDToHeis(2299161,&day,&month,&year);
  2585.     ...
  2586.  
  2587.    NOTES
  2588.     At the moment this is only a dummy to date_JDToGregorian, so:
  2589.     It is better to use this function only from 1718867 to 2889835!
  2590.  
  2591.    BUGS
  2592.     unknown.
  2593.  
  2594.    SEE ALSO
  2595.     JDToJulian(), JDToGregorian()
  2596.  
  2597. Date/JDToJulian                           Date/JDToJulian
  2598.  
  2599.    NAME
  2600.     JDToJulian -- Returns the Julian date for a JD. (V33.095)
  2601.  
  2602.    SYNOPSIS
  2603.     date_JDToJulian(jd,day,month,year);
  2604.             d0 a0    a1    a2
  2605.  
  2606.     void date_JDToJulian(const unsigned long jd, unsigned short *const day,
  2607.         unsigned short *const month, long *const year);
  2608.  
  2609.     void date_JDToJulian(const unsigned long jd, unsigned short &day,
  2610.         unsigned short &month, long &year);
  2611.  
  2612.    FUNCTION
  2613.     Returns the Julian date for a JD.
  2614.  
  2615.    INPUTS
  2616.     jd    - This is the given JD.
  2617.  
  2618.    RESULT
  2619.     day    - Day of the date.
  2620.     month    - Month of the date.
  2621.     year    - Year of the date.
  2622.  
  2623.    EXAMPLE
  2624.     ...
  2625.     date_JDToJulian(2299160,&day,&month,&year);
  2626.     ...
  2627.  
  2628.    NOTES
  2629.     It is better to use this function only from 1718867 to 2299160!
  2630.  
  2631.    BUGS
  2632.     unknown.
  2633.  
  2634.    SEE ALSO
  2635.     JDToGregorian(),JDToHeis()
  2636.  
  2637. Date/JDtoMJD                              Date/JDtoMJD
  2638.  
  2639.    NAME
  2640.     JDtoMJD -- Switches from JD to MJD. (V33)
  2641.  
  2642.    SYNOPSIS
  2643.     mjd = date_JDtoMJD(jd);
  2644.     d0           d0
  2645.  
  2646.     unsigned long date_JDtoMJD(const unsigned long jd);
  2647.  
  2648.    FUNCTION
  2649.     Returns the Modified Julianday of a Julianday.
  2650.  
  2651.    INPUTS
  2652.     jd - Julianday
  2653.  
  2654.    RESULT
  2655.     mjd - The Modified Julianday
  2656.  
  2657.    EXAMPLE
  2658.     ...
  2659.     mjd = date_JDtoMJD(2449354);
  2660.     ...
  2661.  
  2662.    NOTES
  2663.     none
  2664.  
  2665.    BUGS
  2666.     Only use this function for jd > 2400001, because mjd is only
  2667.     defined for this, otherwise system will crash!
  2668.  
  2669.    SEE ALSO
  2670.     MJDtoJD()
  2671.  
  2672. Date/JDToTime                             Date/JDToTime
  2673.  
  2674.    NAME
  2675.     JDToTime -- Returns the real time for a JD time. (V33)
  2676.  
  2677.    SYNOPSIS
  2678.     time_JDToTime(jd,rhour,rmin,rsec);
  2679.               d0  a0    a1   a2
  2680.  
  2681.     void time_JDToTime(float jd, unsigned short *const rhour,
  2682.         unsigned short *const rmin, unsigned short *const rsec);
  2683.  
  2684.     void time_JDToTime(float jd, unsigned short &rhour,
  2685.         unsigned short &rmin, unsigned short &rsec);
  2686.  
  2687.    FUNCTION
  2688.     Returns the real time for a JD time.
  2689.  
  2690.    INPUTS
  2691.     jd - JD time
  2692.  
  2693.    RESULT
  2694.     rhour - 24 hour real time
  2695.     rmin  - real minutes
  2696.     rsec  - real seconds
  2697.  
  2698.    EXAMPLE
  2699.     ...
  2700.     time_JDToTime(0.76543,&rhour,&rmin,&rsec);
  2701.     ...
  2702.  
  2703.    NOTES
  2704.     none.
  2705.  
  2706.    BUGS
  2707.     If jd is > 0 (including days) there will be occur arithmetic bugs!
  2708.  
  2709.    SEE ALSO
  2710.     TimeToJD()
  2711.  
  2712. Date/JSYearToJD                           Date/JSYearToJD
  2713.  
  2714.    NAME
  2715.     JSYearToJD -- Calcs the JD from a Scaliger year. (V33)
  2716.  
  2717.    SYNOPSIS
  2718.     jd = date_JSYearToJD(syear);
  2719.     d0              d0
  2720.  
  2721.     unsigned long date_JSYearToJD(const unsigned long syear);
  2722.  
  2723.    FUNCTION
  2724.     Returns the Julianday of a Scaliger year.
  2725.  
  2726.    INPUTS
  2727.     syear      - Scaliger year
  2728.  
  2729.    RESULT
  2730.     jd - The Julianday
  2731.  
  2732.    EXAMPLE
  2733.     ...
  2734.     jd = date_JSYearToJD(4800);
  2735.     ...
  2736.  
  2737.    NOTES
  2738.     It is better to use this function only from 4707 to 6295!
  2739.  
  2740.    BUGS
  2741.     unknown.
  2742.  
  2743.    SEE ALSO
  2744.     GSYearToJD(),HSYearToJD()
  2745.  
  2746. Date/JulianDayDiff                        Date/JulianDayDiff
  2747.  
  2748.    NAME
  2749.     JulianDayDiff -- Calculates the days between 2 dates. (V33)
  2750.  
  2751.    SYNOPSIS
  2752.     days = date_JulianDayDiff(day1,month1,year1,day2,month2,year2);
  2753.      d0               d0     d1    d2    d3    d4     d5
  2754.  
  2755.     long date_JulianDayDiff(const unsigned short day1, unsigned short month1,
  2756.         long year1, const unsigned short day2, unsigned short month2,
  2757.         long year2);
  2758.  
  2759.    FUNCTION
  2760.     JulianDayDiff gives you back the number of days between
  2761.     two specified dates.
  2762.  
  2763.    INPUTS
  2764.     day1   - day of the first date
  2765.     month1 - month of the first date
  2766.     year1  - year of the first date
  2767.     day2   - day of the second date
  2768.     month2 - month of the second month
  2769.     year2  - year of the second date
  2770.  
  2771.    RESULT
  2772.     days - The number of days between the two dates
  2773.         (positive if date1 <= date2).
  2774.  
  2775.    EXAMPLE
  2776.     long days;
  2777.     ...
  2778.     days = date_JulianDayDiff(18,9,1970,22,1,1994);
  2779.     printf("Age of Kai Hofmann in days : %ld\n",days);
  2780.     ...
  2781.  
  2782.    NOTES
  2783.     It is better only to use this function for years from 8 to 1582!
  2784.  
  2785.    BUGS
  2786.     No known bugs.
  2787.  
  2788.    SEE ALSO
  2789.     JulianLeapYear(),JulianMonthDays(),JulianYearDays(),
  2790.     GregorianDayDiff(),HeisDayDiff()
  2791.  
  2792. Date/JulianDaysAfterWeekday               Date/JulianDaysAfterWeekday
  2793.  
  2794.    NAME
  2795.     JulianDaysAfterWeekday -- Returns the diff to the wday after. (V33)
  2796.  
  2797.    SYNOPSIS
  2798.     days = date_JulianDaysAfterWeekday(day,month,year,weekday);
  2799.      d0                    d0     d1   d2     d3
  2800.  
  2801.     unsigned short date_JulianDaysAfterWeekday(const unsigned short day,
  2802.         const unsigned short month, const long year,
  2803.         const date_Weekdays weekday);
  2804.  
  2805.    FUNCTION
  2806.     Returns the days to the weekday after the specified date.
  2807.     If you specify the 22.1.1994 (Saturday) and Thursday
  2808.     you get back 5!
  2809.     If you specify the 22.1.1994 and Saturday you get back 0
  2810.     (the same day)!
  2811.  
  2812.    INPUTS
  2813.     day    - day of the date
  2814.     month    - month of the date
  2815.     year    - year of the date
  2816.     weekday - weekday to search for building difference
  2817.  
  2818.    RESULT
  2819.     days - The days after to the searched weekday.
  2820.  
  2821.    EXAMPLE
  2822.     ...
  2823.     days = date_JulianDaysAfterWeekday(22,1,1994,Thursday);
  2824.     ...
  2825.  
  2826.    NOTES
  2827.     It is better to use this function only from 8 to 1582!
  2828.  
  2829.    BUGS
  2830.     See JulianWeekday()!
  2831.  
  2832.    SEE ALSO
  2833.     JulianWeekday(),GregorianDaysAfterWeekday(),HeisDaysAfterWeekday()
  2834.  
  2835. Date/JulianDaysBeforeWeekday              Date/JulianDaysBeforeWeekday
  2836.  
  2837.    NAME
  2838.     JulianDaysBeforeWeekday -- Returns the diff to the wday before. (V33)
  2839.  
  2840.    SYNOPSIS
  2841.     days = date_JulianDaysBeforeWeekday(day,month,year,weekday);
  2842.      d0                     d0  d1    d2    d3
  2843.  
  2844.     unsigned short date_JulianDaysBeforeWeekday(const unsigned short day,
  2845.         const unsigned short month, const long year,
  2846.         const date_Weekdays weekday);
  2847.  
  2848.    FUNCTION
  2849.     Returns the days to the weekday before the specified date.
  2850.     If you specify the 22.1.1994 (Saturday) and Thursday
  2851.     you get back 2!
  2852.     If you specify the 22.1.1994 and Saturday you get back 0
  2853.     (the same day)!
  2854.  
  2855.    INPUTS
  2856.     day    - day of the date
  2857.     month    - month of the date
  2858.     year    - year of the date
  2859.     weekday - weekday to search for building difference
  2860.  
  2861.    RESULT
  2862.     days - The days gets you back to the searched weekday (0-6)
  2863.         If you get back an 8 an error occurs!
  2864.  
  2865.    EXAMPLE
  2866.     ...
  2867.     days = date_JulianDaysBeforeWeekday(22,1,1994,Thursday);
  2868.     ...
  2869.  
  2870.    NOTES
  2871.     It is better to use this function only from 8 to 02.1582!
  2872.  
  2873.    BUGS
  2874.     See JulianWeekday()!
  2875.  
  2876.    SEE ALSO
  2877.     JulianWeekday(),GregorianDaysBeforeWeekday(),HeisDaysBeforeWeekday()
  2878.  
  2879. Date/JulianDiffDate                       Date/JulianDiffDate
  2880.  
  2881.    NAME
  2882.     JulianDiffDate -- Returns the date for a diff to another date. (V33)
  2883.  
  2884.    SYNOPSIS
  2885.     date_JulianDiffDate(day,month,year,days,dday,dmonth,dyear);
  2886.                  d0   d1   d2   d3     a0    a1     a2
  2887.  
  2888.     void date_JulianDiffDate(const unsigned short day,
  2889.         const unsigned short month, const long year, long days,
  2890.         unsigned short *const dday, unsigned short *const dmonth,
  2891.         long *const dyear);
  2892.  
  2893.     void date_JulianDiffDate(const unsigned short day,
  2894.         const unsigned short month, const long year, long days,
  2895.         unsigned short &dday, unsigned short &dmonth, long &dyear);
  2896.  
  2897.    FUNCTION
  2898.     Returns the date which lies days before/after the specified date.
  2899.  
  2900.    INPUTS
  2901.     day   - day of the date
  2902.     month - month of the date
  2903.     year  - year of the date
  2904.     days  - difference to the date in days
  2905.  
  2906.    RESULT
  2907.     dday   - Destination day
  2908.     dmonth - Destination month
  2909.     dyear  - Destination year
  2910.  
  2911.    EXAMPLE
  2912.     ...
  2913.     date_JulianDiffDate(23,1,1994,7,&dday,&dmonth,&dyear);
  2914.     ...
  2915.  
  2916.    NOTES
  2917.     This function is OBSOLETE - please use JulianDiffDateRange()
  2918.     instead!
  2919.     It is better to use this function only from 8 to 1582!
  2920.  
  2921.    BUGS
  2922.     unknown.
  2923.  
  2924.    SEE ALSO
  2925.     JulianDayDiff(),JulianMonthDays(),GregorianDiffDate(),HeisDiffDate()
  2926.  
  2927. Date/JulianDiffDateRange                  Date/JulianDiffDateRange
  2928.  
  2929.    NAME
  2930.     JulianDiffDateRange -- Calc new date from old one and diff. (V33.296)
  2931.  
  2932.    SYNOPSIS
  2933.     date_JulianDiffDateRange(day,month,year,days,months,
  2934.         years,dday,dmonth,dyear);
  2935.                   d0   d1   d2     d3    d4
  2936.          d5    a0     a1    a2
  2937.  
  2938.     void date_JulianDiffDateRange(const unsigned short day,
  2939.         const unsigned short month, const long year, long days,
  2940.         long months, long years, unsigned short *const dday,
  2941.         unsigned short *const dmonth, long *const dyear);
  2942.  
  2943.     void date_JulianDiffDateRange(const unsigned short day,
  2944.         const unsigned short month, const long year, long days,
  2945.         long months, long years, unsigned short &dday,
  2946.         unsigned short &dmonth, long &dyear);
  2947.  
  2948.    FUNCTION
  2949.     Returns the date which lies diffrange before/after the specified date.
  2950.  
  2951.    INPUTS
  2952.     day    - day of the date
  2953.     month  - month of the date
  2954.     year   - year of the date
  2955.     days   - difference to the date in days
  2956.     months - difference to the date in months
  2957.     years  - difference to the date in years
  2958.  
  2959.    RESULT
  2960.     dday   - Destination day
  2961.     dmonth - Destination month
  2962.     dyear  - Destination year
  2963.  
  2964.    EXAMPLE
  2965.     ...
  2966.     date_JulianDiffDateRange(23,1,1994,0,0,1,&dday,&dmonth,&dyear);
  2967.     ...
  2968.  
  2969.    NOTES
  2970.     It is better to use this function only from 8 to 1582!
  2971.  
  2972.    BUGS
  2973.     unknown.
  2974.  
  2975.    SEE ALSO
  2976.     JulianDiffDate(),JulianRangeDiff(),GregorianDiffDateRange(),
  2977.     HeisDiffDateRange()
  2978.  
  2979. Date/JulianEaster                         Date/JulianEaster
  2980.  
  2981.    NAME
  2982.     JulianEaster -- Returns the date of Easter in a year (V33.097)
  2983.  
  2984.    SYNOPSIS
  2985.     date_JulianEaster(year,dday,dmonth);
  2986.                d0    a0    a1
  2987.  
  2988.     void date_JulianEaster(const long year, unsigned short *const dday,
  2989.         unsigned short *const dmonth);
  2990.  
  2991.     void date_JulianEaster(const long year, unsigned short &dday,
  2992.         unsigned short &dmonth);
  2993.  
  2994.    FUNCTION
  2995.     Returns the date of Easter for a specified year.
  2996.  
  2997.    INPUTS
  2998.     year  - Easter is calculated for this year
  2999.  
  3000.    RESULT
  3001.     dday   - day of Easter Sunday
  3002.     dmonth - month of Easter Sunday
  3003.  
  3004.    EXAMPLE
  3005.     ...
  3006.     date_JulianEaster(1994,&dday,&dmonth);
  3007.     ...
  3008.  
  3009.    NOTES
  3010.     Use this only for 31 to 1582!
  3011.  
  3012.    BUGS
  3013.     None.
  3014.  
  3015.    SEE ALSO
  3016.     GregorianEaster(),HeisEaster()
  3017.  
  3018. Date/JulianLastMonthDay                   Date/JulianLastMonthDay
  3019.  
  3020.    NAME
  3021.     JulianLastMonthDay -- The number of last day in a month. (V33.234)
  3022.  
  3023.    SYNOPSIS
  3024.     day = date_JulianLastMonthDay(month,year);
  3025.      d0                   d0    d1
  3026.  
  3027.     unsigned short date_JulianLastMonthDay(const unsigned short month,
  3028.         const long year);
  3029.  
  3030.    FUNCTION
  3031.     JulianLastMonthDay returns the number of the last day for a given
  3032.     month.
  3033.  
  3034.    INPUTS
  3035.     month - The month from which you want to get the last day.
  3036.     year  - The year in which the month is.
  3037.  
  3038.    RESULT
  3039.     day - The number of the last day the month uses, or 0 if you use
  3040.         an incorrect month.
  3041.  
  3042.    EXAMPLE
  3043.     ...
  3044.     day = date_JulianLastMonthDay(1,1994); /* 31 */
  3045.     ...
  3046.  
  3047.    NOTES
  3048.     It is better only to use this function for years from 8 to 09.1582!
  3049.  
  3050.    BUGS
  3051.     No known bugs.
  3052.  
  3053.    SEE ALSO
  3054.     JulianMonthDays(),GregorianLastMonthDay(),HeisLastMonthDay()
  3055.  
  3056. Date/JulianLeapYear                       Date/JulianLeapYear
  3057.  
  3058.    NAME
  3059.     JulianLeapYear -- Checks if a year is a leap year. (V33)
  3060.  
  3061.    SYNOPSIS
  3062.     leapyear = date_JulianLeapYear(year);
  3063.        d0                d0
  3064.  
  3065.     bool date_JulianLeapYear(const long year);
  3066.  
  3067.    FUNCTION
  3068.     JulianLeapYear checks if a year is a leap year in the Julian calendar
  3069.     For years after Chr. it checks if the year is devideable by 4.
  3070.     For years before Chr. a leap year must have a modulo 4 value of 1
  3071.  
  3072.    INPUTS
  3073.     year - The year which should be checked (from -32768 to 32767)
  3074.         I think only values from 8 to 32767 are valid, because of
  3075.         the variant that was done by Augustus!
  3076.  
  3077.    RESULT
  3078.     leapyear - true if the year is a leap year, otherwise false.
  3079.  
  3080.    EXAMPLE
  3081.     ...
  3082.     if (date_JulianLeapYear(1994))
  3083.      {
  3084.       printf("leap year!\n");
  3085.      }
  3086.     else
  3087.      {
  3088.       printf("no leap year!\n");
  3089.      }
  3090.     ...
  3091.  
  3092.    NOTES
  3093.     A year is 365.25 days long!
  3094.     Use this function only for values from 8 to 1582!
  3095.  
  3096.    BUGS
  3097.     No known bugs.
  3098.  
  3099.    SEE ALSO
  3100.     GregorianLeapYear(),HeisLeapYear()
  3101.  
  3102. Date/JulianMonthDays                      Date/JulianMonthDays
  3103.  
  3104.    NAME
  3105.     JulianMonthDays -- Returns the number of days of a month. (V33)
  3106.  
  3107.    SYNOPSIS
  3108.     days = date_JulianMonthDays(month,year);
  3109.      d0                 d0    d1
  3110.  
  3111.     unsigned short date_JulianMonthDays(const unsigned short month,
  3112.         const long year);
  3113.  
  3114.    FUNCTION
  3115.     JulianMonthDays returns the number of days a month in
  3116.     a specified year has.
  3117.  
  3118.    INPUTS
  3119.     month - The month from which you want to get the number of days.
  3120.     year  - The year in which the month is.
  3121.  
  3122.    RESULT
  3123.     days - The number of days the month uses, or 0 if you use
  3124.         an incorrect month.
  3125.  
  3126.    EXAMPLE
  3127.     unsigned short days;
  3128.     ...
  3129.     days = date_JulianMonthDays(1,1994);
  3130.     printf("Days of January 1994 : %hu\n",days);
  3131.     ...
  3132.  
  3133.    NOTES
  3134.     It is better only to use this function for years from 8 to 09.1582!
  3135.  
  3136.    BUGS
  3137.     No known bugs.
  3138.  
  3139.    SEE ALSO
  3140.     JulianLeapYear(),GregorianMonthDays(),HeisMonthDays()
  3141.  
  3142. Date/JulianRangeDiff                      Date/JulianRangeDiff
  3143.  
  3144.    NAME
  3145.     JulianRangeDiff -- Calculates the range between 2 dates. (V33.297)
  3146.  
  3147.    SYNOPSIS
  3148.     date_JulianRangeDiff(day1,month1,year1,day2,month2,year2,days,months,
  3149.         years);
  3150.                   d0    d1      d2    d3    d4    d5      a0    a1
  3151.          a2
  3152.  
  3153.     void date_JulianRangeDiff(unsigned short day1,
  3154.         unsigned short month1, long year1, unsigned short day2,
  3155.         unsigned short month2, long year2, short *const days,
  3156.         short *const months, long *const years);
  3157.  
  3158.     void date_JulianRangeDiff(unsigned short day1,
  3159.         unsigned short month1, long year1, unsigned short day2,
  3160.         unsigned short month2, long year2, short &days, short &months,
  3161.         long &years);
  3162.  
  3163.    FUNCTION
  3164.     JulianRangeDiff gives you back the number of days, months and years
  3165.     between two specified dates.
  3166.  
  3167.    INPUTS
  3168.     day1   - day of the first date
  3169.     month1 - month of the first date
  3170.     year1  - year of the first date
  3171.     day2   - day of the second date
  3172.     month2 - month of the second month
  3173.     year2  - year of the second date
  3174.  
  3175.    RESULT
  3176.     days   - The number of days between the two dates
  3177.          (positive if date1 <= date2).
  3178.     months - The number of months between the two dates
  3179.          (positive if date1 <= date2).
  3180.     years  - The number of years between the two dates
  3181.          (positive if date1 <= date2).
  3182.  
  3183.    EXAMPLE
  3184.     short days,months;
  3185.     long years;
  3186.     ...
  3187.     date_JulianRangeDiff(18,9,1970,25,1,1998,&days,&months,&years);
  3188.     printf("Age of Kai Hofmann is : %ld years, %hd months, %hd days\n",
  3189.        years,months,days);
  3190.     ...
  3191.  
  3192.    NOTES
  3193.     It is better only to use this function for years from 8 to 1582!
  3194.  
  3195.    BUGS
  3196.     No known bugs.
  3197.  
  3198.    SEE ALSO
  3199.     JulianDayDiff(),JulianDiffDateRange(),GregorianRangeDiff(),
  3200.     HeisRangeDiff()
  3201.  
  3202. Date/JulianToJD                           Date/JulianToJD
  3203.  
  3204.    NAME
  3205.     JulianToJD -- Returns the JD for a date. (V33)
  3206.  
  3207.    SYNOPSIS
  3208.     jd = date_JulianToJD(day,month,year);
  3209.     d0              d0   d1     d2
  3210.  
  3211.     unsigned long date_JulianToJD(const unsigned short day,
  3212.         const unsigned short month, const long year);
  3213.  
  3214.    FUNCTION
  3215.     Returns the JD for a Julian date.
  3216.  
  3217.    INPUTS
  3218.     day     - day of the date to convert
  3219.     month     - month of the date to convert
  3220.     year     - year of the date to convert
  3221.  
  3222.    RESULT
  3223.     jd - This is the JD
  3224.  
  3225.    EXAMPLE
  3226.     ...
  3227.     jd = date_JulianToJD(23,1,1994);
  3228.     ...
  3229.  
  3230.    NOTES
  3231.     It is better to use this function only from 8 to 1582!
  3232.  
  3233.    BUGS
  3234.     unknown.
  3235.  
  3236.    SEE ALSO
  3237.     JSYearToJD(),JYearToScaliger(),JulianDayDiff(),GregorianToJD(),
  3238.     HeisToJD()
  3239.  
  3240. Date/JulianWeek                           Date/JulianWeek
  3241.  
  3242.    NAME
  3243.     JulianWeek -- Gets the number of the week for a specified date. (V33)
  3244.  
  3245.    SYNOPSIS
  3246.     weeknr = date_JulianWeek(day,month,year);
  3247.       d0              d0    d1   d2
  3248.  
  3249.     unsigned short date_JulianWeek(const unsigned short day,
  3250.         const unsigned short month, const long year);
  3251.  
  3252.    FUNCTION
  3253.     JulianWeek gets the number of the week for a specified date.
  3254.  
  3255.    INPUTS
  3256.     day   - day of the date
  3257.     month - month of the date
  3258.     year  - year of the date
  3259.  
  3260.    RESULT
  3261.     week - This is the number of the week the specified date lies in.
  3262.         If the first day in a new year is a Friday, Saturday or
  3263.         Sunday, this would be the last week of the last year!
  3264.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  3265.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  3266.         first week of the next year!
  3267.  
  3268.    EXAMPLE
  3269.     ...
  3270.     weeknr = date_JulianWeek(4,10,1582);
  3271.     ...
  3272.  
  3273.    NOTES
  3274.     It is is better only to use this function for years from 8 to 1582!
  3275.  
  3276.    BUGS
  3277.     For years < 0 errors could occur.
  3278.  
  3279.    SEE ALSO
  3280.     GregorianWeek(),HeisWeek(),JulianWeekday(),JulianDayDiff(),
  3281.     SetFirstWeekday()
  3282.  
  3283. Date/JulianWeekday                        Date/JulianWeekday
  3284.  
  3285.    NAME
  3286.     JulianWeekday -- Gets the weekday of a specified date. (V33)
  3287.  
  3288.    SYNOPSIS
  3289.     weekday = date_JulianWeekday(day,month,year);
  3290.       d0                  d0   d1    d2
  3291.  
  3292.     date_Weekdays date_JulianWeekday(const unsigned short day,
  3293.         unsigned short month, long year);
  3294.  
  3295.    FUNCTION
  3296.     JulianWeekday gets the weekday for a specified date.
  3297.  
  3298.    INPUTS
  3299.     day   - day of the date
  3300.     month - month of the date
  3301.     year  - year of the date
  3302.  
  3303.    RESULT
  3304.     weekday - This result is of type:
  3305.         date_Weekdays = {date_dayerr,date_Monday,date_Tuesday,
  3306.                  date_Wednesday,date_Thursday,date_Friday,
  3307.                  date_Saturday,date_Sunday};
  3308.         dayerr will show you, that an error occurs!
  3309.  
  3310.    EXAMPLE
  3311.     ...
  3312.     weekday = date_JulianWeekday(4,10,1582);
  3313.     if (weekday == dayerr)
  3314.      {
  3315.       ...
  3316.      }
  3317.     ...
  3318.  
  3319.    NOTES
  3320.     It is better only to use this function for years from 8 to 4.10.1582!
  3321.     In this version no dayerr will occur!
  3322.  
  3323.    BUGS
  3324.     For years <= 0 errors could occur, or systemcrashs(?).
  3325.  
  3326.    SEE ALSO
  3327.     GregorianWeekday(),HeisWeekday()
  3328.  
  3329. Date/JulianWWtoDM                         Date/JulianWWtoDM
  3330.  
  3331.    NAME
  3332.     JulianWWtoDM -- Convert Weekday,Week to Day,Month. (V33.243)
  3333.  
  3334.    SYNOPSIS
  3335.     date_JulianWWtoDM(weekday,week,year,dday,dmonth,dyear);
  3336.                  d0    d1    d2   a0    a1      a2
  3337.  
  3338.     void date_JulianWWtoDM(const date_Weekdays weekday,
  3339.        const unsigned short week, const long year,
  3340.        unsigned short *const dday, unsigned short *const dmonth,
  3341.        long *const dyear);
  3342.  
  3343.     void date_JulianWWtoDM(const date_Weekdays weekday,
  3344.        const unsigned short week, const long year,
  3345.        unsigned short &dday, unsigned short &dmonth,
  3346.        long &dyear);
  3347.  
  3348.    FUNCTION
  3349.     Converts weekday,week to day,month.
  3350.  
  3351.    INPUTS
  3352.     weekday  - weekday of the date to convert
  3353.     week     - week of the date to convert
  3354.     year     - year of the date to convert
  3355.  
  3356.    RESULT
  3357.     day   - day of the converted date
  3358.     month - month of the converted date
  3359.     year  - year of the converted date
  3360.  
  3361.    EXAMPLE
  3362.     unsigned short day,month;
  3363.     long year;
  3364.     ...
  3365.     date_JulianWWtoDM(date_Thursday,14,1997,&day,&month,&year);
  3366.     /* 1997-04-03 */
  3367.     ...
  3368.  
  3369.    NOTES
  3370.     It is better to use this function only from 8 to 1582!
  3371.     Be careful, the resulting year might be different from the input
  3372.     year!
  3373.  
  3374.    BUGS
  3375.     unknown.
  3376.  
  3377.    SEE ALSO
  3378.     GregorianWWtoDM(), HeisWWtoDM()
  3379.  
  3380. Date/JulianYearDays                       Date/JulianYearDays
  3381.  
  3382.    NAME
  3383.     JulianYearDays -- Gives back the number of days in a year. (V33)
  3384.  
  3385.    SYNOPSIS
  3386.     days = date_JulianYearDays(year);
  3387.      d0                d0
  3388.  
  3389.     unsigned short date_JulianYearDays(const long year);
  3390.  
  3391.    FUNCTION
  3392.     JulianYearDays gives you back the number of days in
  3393.     a specified year.
  3394.  
  3395.    INPUTS
  3396.     year  - The year in which to count the days.
  3397.  
  3398.    RESULT
  3399.     days - The number of days the year uses.
  3400.  
  3401.    EXAMPLE
  3402.     unsigned short days;
  3403.     ...
  3404.     days = date_JulianYearDays(1994);
  3405.     printf("Days of 1994 : %hu\n",days);
  3406.     ...
  3407.  
  3408.    NOTES
  3409.     It is better only to use this function for years from 8 to 1581!
  3410.  
  3411.    BUGS
  3412.     No known bugs.
  3413.  
  3414.    SEE ALSO
  3415.     JulianMonthDays(),GregorianYearDays(),HeisYearDays()
  3416.  
  3417. Date/JYearToScaliger                      Date/JYearToScaliger
  3418.  
  3419.    NAME
  3420.     JYearToScaliger -- Returns the year as Scaliger year. (V33)
  3421.  
  3422.    SYNOPSIS
  3423.     syear = date_JYearToScaliger(year);
  3424.      d0                  d0
  3425.  
  3426.     unsigned long date_JYearToScaliger(const long year);
  3427.  
  3428.    FUNCTION
  3429.     Returns the Scaliger year.
  3430.  
  3431.    INPUTS
  3432.     year     - Julian year
  3433.  
  3434.    RESULT
  3435.     syear - The Scaliger year
  3436.  
  3437.    EXAMPLE
  3438.     ...
  3439.     syear = date_JYearToScaliger(1582);
  3440.     ...
  3441.  
  3442.    NOTES
  3443.     It is better to use this function only from 8 to 1582!
  3444.  
  3445.    BUGS
  3446.     unknown.
  3447.  
  3448.    SEE ALSO
  3449.     GYearToScaliger(),HYearToScaliger()
  3450.  
  3451. Date/LastMonthDay                         Date/LastMonthDay
  3452.  
  3453.    NAME
  3454.     LastMonthDay -- The number of last day in a month. (V33.310)
  3455.  
  3456.    SYNOPSIS
  3457.     day = date_LastMonthDay(month,year,calendar);
  3458.      d0              d0    d1   d2
  3459.  
  3460.     unsigned short date_LastMonthDay(const unsigned short month,
  3461.         const long year, const date_Calendars calendar);
  3462.  
  3463.    FUNCTION
  3464.     LastMonthDay returns the number of the last day for a given
  3465.     month.
  3466.  
  3467.    INPUTS
  3468.     month    - The month from which you want to get the last day.
  3469.     year     - The year in which the month is.
  3470.     calendar - Calendar system to use
  3471.  
  3472.    RESULT
  3473.     days - The number of the last day the month uses, or 0 if you use
  3474.         an incorrect month.
  3475.  
  3476.    EXAMPLE
  3477.     ...
  3478.     day = date_LastMonthDay(1,1994,date_Gregorian); /* 31 */
  3479.     ...
  3480.  
  3481.    NOTES
  3482.     Use this function only for years from 8 to 3199!
  3483.  
  3484.    BUGS
  3485.     none.
  3486.  
  3487.    SEE ALSO
  3488.     JulianLastMonthDay(),GregorianLastMonthDay(),HeisLastMonthDay()
  3489.  
  3490. Date/LeapYear                             Date/LeapYear
  3491.  
  3492.    NAME
  3493.     LeapYear -- Checks if a year is a leap year. (V33.310)
  3494.  
  3495.    SYNOPSIS
  3496.     leapyear = date_LeapYear(year,calendar);
  3497.        d0               d0   d1
  3498.  
  3499.     bool date_LeapYear(const long year, const date_Calendars calendar);
  3500.  
  3501.    FUNCTION
  3502.     LeapYear checks if a year is a leap year.
  3503.  
  3504.    INPUTS
  3505.     year     - The year which should be checked (from -32768 to 32767)
  3506.                I think only values from 8 to 3200 are valid, because of
  3507.                the variant that was done by Augustus!
  3508.     calendar - Calendar system to use
  3509.  
  3510.    RESULT
  3511.     leapyear - true if the year is a leap year, otherwise false.
  3512.  
  3513.    EXAMPLE
  3514.     ...
  3515.     if (date_LeapYear(1994,date_Gregorian))
  3516.      {
  3517.       printf("leap year!\n");
  3518.      }
  3519.     else
  3520.      {
  3521.       printf("no leap year!\n");
  3522.      }
  3523.     ...
  3524.  
  3525.    NOTES
  3526.     Use this function only for values from 8 to 8000!
  3527.  
  3528.    BUGS
  3529.     No known bugs.
  3530.  
  3531.    SEE ALSO
  3532.     JulianLeapYear(),GregorianLeapYear(),HeisLeapYear()
  3533.  
  3534. Date/LMT                                  Date/LMT
  3535.  
  3536.    NAME
  3537.     LMT -- Calculates your local time in your timezone (V33)
  3538.  
  3539.    SYNOPSIS
  3540.     secs = time_LMT(secs,meridian,pos);
  3541.      d0         d0    d1    d2
  3542.  
  3543.     unsigned long time_LMT(const unsigned long secs,
  3544.         const float meridiandegree, const float posdegree);
  3545.  
  3546.    FUNCTION
  3547.     Calculates your Local Mean Time of your place!
  3548.  
  3549.    INPUTS
  3550.     secs     - Seconds of the running day (hours*3600+min*60+sec)
  3551.     meridian - Degrees of your timezone-meridian
  3552.     pos     - Degrees of your place
  3553.  
  3554.    RESULT
  3555.     secs - Local seconds of the running day
  3556.  
  3557.    EXAMPLE
  3558.     ...
  3559.     secs = time_LMT(76080,-15.0,-8.923055556);
  3560.     ...
  3561.  
  3562.    NOTES
  3563.     none
  3564.  
  3565.    BUGS
  3566.     No errorcheck, if you put in valid degrees (-180 to +180)
  3567.  
  3568.    SEE ALSO
  3569.  
  3570.  
  3571. Date/LocalToGMT                           Date/LocalToGMT
  3572.  
  3573.    NAME
  3574.     LocalToGMT -- Converts a local time to GMT (V33.300)
  3575.  
  3576.    SYNOPSIS
  3577.     datetime_LocalToGMT(ljd,lsecs,DST,zonemin,gjd,gsecs);
  3578.                  d0   d1  d2    d3      a0   a1
  3579.  
  3580.     void datetime_LocalToGMT(const unsigned long ljd,
  3581.         const unsigned long lsecs, const bool DST,
  3582.         const short zonemin, unsigned long *const gjd,
  3583.         unsigned long *const gsecs);
  3584.  
  3585.     void datetime_LocalToGMT(const unsigned long ljd,
  3586.         const unsigned long lsecs, const bool DST,
  3587.         const short zonemin, unsigned long &gjd,
  3588.         unsigned long &gsecs);
  3589.  
  3590.    FUNCTION
  3591.     Converts a local date/time pair into a GMT date/time pair.
  3592.     The conversion considers the local daylight savings time.
  3593.  
  3594.    INPUTS
  3595.     ljd       - Local Julian Date
  3596.     lsecs       - Local time in seconds
  3597.     DST       - Daylight saving status
  3598.     zonemin    - Time that was added to GMT time to get the local time
  3599.              zone (in minutes -779 to +779)
  3600.  
  3601.    RESULT
  3602.     gjd   - GMT Julian Date
  3603.     gsecs - GMT time in seconds
  3604.  
  3605.    EXAMPLE
  3606.     unsigned long gjd,gsecs;
  3607.     ...
  3608.     datetime_LocalToGMT(2450919,37500,true,+60,&gjd,&gsecs);
  3609.     ...
  3610.  
  3611.    NOTES
  3612.     None.
  3613.  
  3614.    BUGS
  3615.     No errorcheck, if you use a valid date/time.
  3616.  
  3617.    SEE ALSO
  3618.     GMTToLocal(), JulianToJD(), GregorianToJD(), HeisToJD(),
  3619.     JDToJulian(), JDToGregorian(), JDToHeis(), TimeToSec(), SecToTime(),
  3620.     TimeZoneFactor()
  3621.  
  3622. Date/MJDtoJD                              Date/MJDtoJD
  3623.  
  3624.    NAME
  3625.     MJDtoJD -- Switches from MJD to JD. (V33)
  3626.  
  3627.    SYNOPSIS
  3628.     jd = date_MJDtoJD(mjd);
  3629.     d0           d0
  3630.  
  3631.     unsigned long date_MJDtoJD(const unsigned long mjd);
  3632.  
  3633.    FUNCTION
  3634.     Returns the Julianday of a Modified Julianday.
  3635.  
  3636.    INPUTS
  3637.     mjd - Modified Julianday
  3638.  
  3639.    RESULT
  3640.     jd - The Julianday
  3641.  
  3642.    EXAMPLE
  3643.     ...
  3644.     jd = date_MJDtoJD(49353);
  3645.     ...
  3646.  
  3647.    NOTES
  3648.     none
  3649.  
  3650.    BUGS
  3651.     unknown.
  3652.  
  3653.    SEE ALSO
  3654.     JDtoMJD()
  3655.  
  3656. Date/MonthDays                         Date/MonthDays
  3657.  
  3658.    NAME
  3659.     MonthDays -- Returns the number of days of a month. (V33.310)
  3660.  
  3661.    SYNOPSIS
  3662.     days = date_MonthDays(month,year,calendar);
  3663.      d0            d0    d1    d2
  3664.  
  3665.     unsigned short date_MonthDays(const unsigned short month,
  3666.         const long year, const date_Calendars calendar);
  3667.  
  3668.    FUNCTION
  3669.     MonthDays returns the number of days a month in
  3670.     a specified year has.
  3671.     For the year 1582 and the month 10 there are only 21 days,
  3672.     because of the -reform 10 days are deleted from
  3673.     the month (for more - look out for books about this!)
  3674.  
  3675.    INPUTS
  3676.     month    - The month from which you want to get the number of days.
  3677.     year     - The year in which the month is.
  3678.     calendar - Calendar system to use
  3679.  
  3680.    RESULT
  3681.     days - The number of days the month uses, or 0 if you use
  3682.         an incorrect month.
  3683.  
  3684.    EXAMPLE
  3685.     unsigned short days;
  3686.     ...
  3687.     days = date_MonthDays(1,1994,date_Gregorian);
  3688.     printf("Days of January 1994 : %hu\n",days);
  3689.     ...
  3690.  
  3691.    NOTES
  3692.     Use this function only for years from 8 to 8000!
  3693.  
  3694.    BUGS
  3695.     none.
  3696.  
  3697.    SEE ALSO
  3698.     JulianMonthDays(),GregorianMonthDays(),HeisMonthDays()
  3699.  
  3700. Date/MonthShortText                       Date/MonthShortText
  3701.  
  3702.    NAME
  3703.     MonthShortText -- Get the month as short text string. (V33.092)
  3704.  
  3705.    SYNOPSIS
  3706.     maxlen = date_MonthShortText(month,mtext,lang);
  3707.      d0                  d0   a0     d1
  3708.  
  3709.     unsigned short date_MonthShortText(const unsigned short month,
  3710.         char *const mtext, const date_Languages lang);
  3711.  
  3712.    FUNCTION
  3713.     This function gets the short text string for the month-number.
  3714.  
  3715.    INPUTS
  3716.     month - Month to transform into a string.
  3717.     mtext - Pointer to a string to fill in the short month-text.
  3718.     lang  - Language for which you want the short month-text.
  3719.  
  3720.    RESULT
  3721.     maxlen - Maximum possible length for the short month-string, this
  3722.         should help you if you want to justify the string right or if
  3723.         you want to center it (Normal is three!).
  3724.         0 indicates an error!
  3725.  
  3726.    EXAMPLE
  3727.     ...
  3728.     char mtxt[4];
  3729.     ...
  3730.     maxlen = date_MonthShortText(12,&mtxt,English);
  3731.     ...
  3732.  
  3733.    NOTES
  3734.     Languages:
  3735.     Locale      : This is an Amiga >= OS2.1 only feature, for <= OS2.0
  3736.             and other systems it will return English text!
  3737.  
  3738.    BUGS
  3739.     In this version there is no check, if there is enough space in
  3740.     wtext!
  3741.  
  3742.    SEE ALSO
  3743.     WeekdayText(),WeekdayShortText(),MonthText()
  3744.  
  3745. Date/MonthText                         Date/MonthText
  3746.  
  3747.    NAME
  3748.     MonthText -- Get the month as text string. (V33.091)
  3749.  
  3750.    SYNOPSIS
  3751.     maxlen = date_MonthText(month,mtext,lang);
  3752.      d0             d0   a0    d1
  3753.  
  3754.     unsigned short date_MonthText(const unsigned short month,
  3755.         char *const mtext, const date_Languages lang);
  3756.  
  3757.    FUNCTION
  3758.     This function gets the text string for the month-number.
  3759.  
  3760.    INPUTS
  3761.     month - Month to transform into a string.
  3762.     mtext - Pointer to a string to fill in the month-text.
  3763.     lang  - Language for which you want the month-text.
  3764.  
  3765.    RESULT
  3766.     maxlen - Maximum possible length for the month-string, this should
  3767.         help you if you want to justify the string right or if you
  3768.         want to center it!
  3769.         0 indicates an error!
  3770.  
  3771.    EXAMPLE
  3772.     ...
  3773.     char mtxt[20];
  3774.     ...
  3775.     maxlen = date_MonthText(12,&mtxt,English);
  3776.     ...
  3777.  
  3778.    NOTES
  3779.     Languages:
  3780.     Locale      : This is an Amiga >= OS2.1 only feature, for <= OS2.0
  3781.             and other systems it will return English text!
  3782.  
  3783.    BUGS
  3784.     In this version there is no check, if there is enough space in
  3785.     wtext!
  3786.  
  3787.    SEE ALSO
  3788.     WeekdayText(),WeekdayShortText(),MonthShortText()
  3789.  
  3790. Date/NextValidDate                        Date/NextValidDate
  3791.  
  3792.    NAME
  3793.     NextValidDate -- Returns the next valid date (V33.310)
  3794.  
  3795.    SYNOPSIS
  3796.     date_NextValidDate(day,month,year,dday,dmonth,dyear,calendar);
  3797.                 d0   d1  d2    a0      a1     a2   d3
  3798.  
  3799.     void date_NextValidDate(const unsigned short day,
  3800.         const unsigned short month, const long year,
  3801.         unsigned short *const dday, unsigned short *const dmonth,
  3802.         long *const dyear, const date_Calendars calendar);
  3803.  
  3804.     void date_NextValidDate(const unsigned short day,
  3805.         const unsigned short month, const long year,
  3806.         unsigned short &dday, unsigned short &dmonth, long &dyear,
  3807.         const date_Calendars calendar);
  3808.  
  3809.    FUNCTION
  3810.     Returns the next valid date after a given one.
  3811.  
  3812.    INPUTS
  3813.     day      - Day of the date.
  3814.     month    - Month of the date.
  3815.     year     - Year of the date.
  3816.     calendar - Calendar system to use
  3817.  
  3818.    RESULT
  3819.     dday   - Day of the next valid date
  3820.     dmonth - Month of the next valid date
  3821.     dyear  - Year of the next valid date
  3822.  
  3823.    EXAMPLE
  3824.     ...
  3825.     date_NextValidDate(29,2,2000,&day,&month,&year,date_Gregorian);
  3826.     ...
  3827.  
  3828.    NOTES
  3829.     None.
  3830.  
  3831.    BUGS
  3832.     None.
  3833.  
  3834.    SEE ALSO
  3835.     ValidDate(),NextValidJulianDate(),NextValidGregorianDate(),
  3836.     NextValidHeisDate(),PreviousValidDate()
  3837.  
  3838. Date/NextValidGregorianDate               Date/NextValidGregorianDate
  3839.  
  3840.    NAME
  3841.     NextValidGregorianDate -- Returns the next valid date (V33.236)
  3842.  
  3843.    SYNOPSIS
  3844.     date_NextValidGregorianDate(day,month,year,dday,dmonth,dyear);
  3845.                      d0   d1  d2    a0      a1     a2
  3846.  
  3847.     void date_NextValidGregorianDate(const unsigned short day,
  3848.        const unsigned short month, const long year,
  3849.        unsigned short *const dday, unsigned short *const dmonth,
  3850.        long *const dyear);
  3851.  
  3852.     void date_NextValidGregorianDate(const unsigned short day,
  3853.        const unsigned short month, const long year,
  3854.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  3855.  
  3856.    FUNCTION
  3857.     Returns the next valid date after a given one.
  3858.  
  3859.    INPUTS
  3860.     day   - Day of the date.
  3861.     month - Month of the date.
  3862.     year  - Year of the date.
  3863.  
  3864.    RESULT
  3865.     dday   - Day of the next valid date
  3866.     dmonth - Month of the next valid date
  3867.     dyear  - Year of the next valid date
  3868.  
  3869.    EXAMPLE
  3870.     ...
  3871.     date_NextValidGregorianDate(29,2,2000,&day,&month,&year);
  3872.     ...
  3873.  
  3874.    NOTES
  3875.     None.
  3876.  
  3877.    BUGS
  3878.     None.
  3879.  
  3880.    SEE ALSO
  3881.     ValidGregorianDate(),NextValidJulianDate(),NextValidHeisDate(),
  3882.     PreviousValidGregorianDate()
  3883.  
  3884. Date/NextValidHeisDate                 Date/NextValidHeisDate
  3885.  
  3886.    NAME
  3887.     NextValidHeisDate -- Returns the next valid date (V33.235)
  3888.  
  3889.    SYNOPSIS
  3890.     date_NextValidHeisDate(day,month,year,dday,dmonth,dyear);
  3891.                 d0   d1  d2    a0    a1     a2
  3892.  
  3893.     void date_NextValidHeisDate(const unsigned short day,
  3894.        const unsigned short month, const long year,
  3895.        unsigned short *const dday, unsigned short *const dmonth,
  3896.        long *const dyear);
  3897.  
  3898.     void date_NextValidHeisDate(const unsigned short day,
  3899.        const unsigned short month, const long year,
  3900.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  3901.  
  3902.    FUNCTION
  3903.     Returns the next valid date after a given one.
  3904.  
  3905.    INPUTS
  3906.     day   - Day of the date.
  3907.     month - Month of the date.
  3908.     year  - Year of the date.
  3909.  
  3910.    RESULT
  3911.     dday   - Day of the next valid date
  3912.     dmonth - Month of the next valid date
  3913.     dyear  - Year of the next valid date
  3914.  
  3915.    EXAMPLE
  3916.     ...
  3917.     date_NextValidHeisDate(29,2,2000,&day,&month,&year);
  3918.     ...
  3919.  
  3920.    NOTES
  3921.     None.
  3922.  
  3923.    BUGS
  3924.     None.
  3925.  
  3926.    SEE ALSO
  3927.     ValidHeisDate(),NextValidJulianDate(),NextValidGregorianDate(),
  3928.     PreviousValidHeisDate()
  3929.  
  3930. Date/NextValidJulianDate                  Date/NextValidJulianDate
  3931.  
  3932.    NAME
  3933.     NextValidJulianDate -- Returns the next valid date (V33.236)
  3934.  
  3935.    SYNOPSIS
  3936.     date_NextValidJulianDate(day,month,year,dday,dmonth,dyear);
  3937.                   d0   d1  d2     a0    a1     a2
  3938.  
  3939.     void date_NextValidJulianDate(const unsigned short day,
  3940.        const unsigned short month, const long year,
  3941.        unsigned short *const dday, unsigned short *const dmonth,
  3942.        long *const dyear);
  3943.  
  3944.     void date_NextValidJulianDate(const unsigned short day,
  3945.        const unsigned short month, const long year,
  3946.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  3947.  
  3948.    FUNCTION
  3949.     Returns the next valid date after a given one.
  3950.  
  3951.    INPUTS
  3952.     day   - Day of the date.
  3953.     month - Month of the date.
  3954.     year  - Year of the date.
  3955.  
  3956.    RESULT
  3957.     dday   - Day of the next valid date
  3958.     dmonth - Month of the next valid date
  3959.     dyear  - Year of the next valid date
  3960.  
  3961.    EXAMPLE
  3962.     ...
  3963.     date_NextValidJulianDate(29,2,2000,&day,&month,&year);
  3964.     ...
  3965.  
  3966.    NOTES
  3967.     None.
  3968.  
  3969.    BUGS
  3970.     None.
  3971.  
  3972.    SEE ALSO
  3973.     ValidJulianDate(),NextValidGregorianDate(),NextValidHeisDate(),
  3974.     PreviousValidJulianDate()
  3975.  
  3976. Date/NumToDate                         Date/NumToDate
  3977.  
  3978.    NAME
  3979.     NumToDate -- Returns the real date for a numeric time. (V33.250)
  3980.  
  3981.    SYNOPSIS
  3982.     date_NumToDate(num,day,month,year);
  3983.                d0  a0    a1    a2
  3984.  
  3985.     void date_NumToDate(long num, unsigned short *const day,
  3986.         unsigned short *const month, long *const year);
  3987.  
  3988.     void date_NumToDate(long num, unsigned short &day,
  3989.         unsigned short &month, long &year);
  3990.  
  3991.    FUNCTION
  3992.     Returns the real date for a numeric time.
  3993.  
  3994.    INPUTS
  3995.     num - Date in numeric format
  3996.  
  3997.    RESULT
  3998.     day    - Day of the date.
  3999.     month    - Month of the date.
  4000.     year    - Year of the date.
  4001.  
  4002.    EXAMPLE
  4003.     ...
  4004.     date_NumToDate(19970628,&day,&month,&year);
  4005.     ...
  4006.  
  4007.    NOTES
  4008.     Negative years will be handled correctly.
  4009.  
  4010.    BUGS
  4011.     None.
  4012.  
  4013.    SEE ALSO
  4014.     DateToNum()
  4015.  
  4016. Date/NumToTime                         Date/NumToTime
  4017.  
  4018.    NAME
  4019.     NumToTime -- Returns the real time for a numeric time. (V33.250)
  4020.  
  4021.    SYNOPSIS
  4022.     time_NumToTime(num,rhour,rmin,rsec);
  4023.             d0  a0      a1   a2
  4024.  
  4025.     void time_NumToTime(unsigned short num,
  4026.         unsigned short *const rhour, unsigned short *const rmin,
  4027.         unsigned short *const rsec);
  4028.  
  4029.     void time_NumToTime(unsigne dshort num, unsigned short &rhour,
  4030.         unsigned short &rmin, unsigned short &rsec);
  4031.  
  4032.    FUNCTION
  4033.     Returns the real time for a numeric time.
  4034.  
  4035.    INPUTS
  4036.     num - Numeric time
  4037.  
  4038.    RESULT
  4039.     rhour - hours
  4040.     rmin  - minutes
  4041.     rsec  - seconds
  4042.  
  4043.    EXAMPLE
  4044.     ...
  4045.     time_NumToTime(123600,&rhour,&rmin,&rsec);
  4046.     ...
  4047.  
  4048.    NOTES
  4049.     None.
  4050.  
  4051.    BUGS
  4052.     None.
  4053.  
  4054.    SEE ALSO
  4055.     TimeToNum()
  4056.  
  4057. Date/ParseDate                         Date/ParseDate
  4058.  
  4059.    NAME
  4060.     ParseDate -- Parses a date string (V33.290)
  4061.  
  4062.    SYNOPSIS
  4063.     pos = date_ParseDate(fmt,dstr,lang,calendar,actualjd,
  4064.        day,month,year,pfmt,plang);
  4065.                   d0  d1    d2    d3       d4
  4066.        a0     a1    a2  a3     d5
  4067.  
  4068.     short date_ParseDate(const char *const fmt, const char *const dstr,
  4069.        const date_Languages lang, const date_Calendars calendar,
  4070.        const unsigned long actualjd, unsigned short *const day,
  4071.        unsigned short *const month, long *const year, char *const pfmt,
  4072.        date_Languages *const plang);
  4073.  
  4074.     short date_ParseDate(const char *const fmt, const char *const dstr,
  4075.        const date_Languages lang, const date_Calendars calendar,
  4076.        const unsigned long actualjd, unsigned short *const day,
  4077.        unsigned short *const month, long *const year, char *const pfmt,
  4078.        date_Languages &plang);
  4079.  
  4080.    FUNCTION
  4081.     Parses the date from a string.
  4082.  
  4083.    INPUTS
  4084.     fmt        - Format template string
  4085.     dstr        - Datestring to parse
  4086.     lang        - Language to use for strings
  4087.     calendar    - Calendar system to use for decoding
  4088.     actualjd    - Actual date in JD form
  4089.     pfmt        - Buffer for format template of parsed string or NULL
  4090.  
  4091.    RESULT
  4092.     pos    -  0 : The string has been parsed successfully.
  4093.           >0 : An error occured during parsing - subtract one to get
  4094.                the position of the error within the string.
  4095.           -1 : Parameter error (one or more pointers are pointing to
  4096.                NULL)
  4097.           -2 : Format template string to long
  4098.     day    - Day of the date to format
  4099.     month    - Month of the date to format
  4100.     year    - Year of the date to format
  4101.     pfmt    - Format template of parsed string
  4102.     plang    - Parsed language
  4103.  
  4104.    EXAMPLE
  4105.     short retval;
  4106.     unsigned short day,month;
  4107.     long year;
  4108.     char pfmtbuf[20];
  4109.     date_Languages lang;
  4110.     ...
  4111.     retval = date_ParseDate("%Y-%m-%d","1997-04-03",date_Locale,
  4112.        date_Heis,2450809,&day,&month,&year,pfmtbuf,&lang);
  4113.     ...
  4114.  
  4115.    SYNTAX
  4116.     Syntax of Amiga compatible % commands:
  4117.     %d : Day number with leading 0s
  4118.     %e : Day number with leading spaces
  4119.     %m : Month number with leading 0s
  4120.     %h : Abbreviated month name
  4121.     %b : Abbreviated month name
  4122.     %B : Month name
  4123.     %y : Year using two digits with leading 0s
  4124.     %Y : Year using four digits with leading 0s
  4125.     %j : Julian date
  4126.     %w : Weekday number
  4127.     %a : Abbreviated weekday name
  4128.     %A : Weekday name
  4129.     %U : Week number, taking Sunday as first day of week
  4130.     %W : Week number, taking Monday as first day of week
  4131.     %x : Same as "%m/%d/%y"
  4132.     %D : Same as "%m/%d/%y"
  4133.  
  4134.     Syntax of % commands:
  4135.     %Ddf  : Day with leading 0s
  4136.     %Ddv  : Day without leading 0s
  4137.     %DDf  : Day within the year with leading 0s
  4138.     %DDv  : Day within the year without leading 0s
  4139.     %Dmf  : Month with leading 0s
  4140.     %Dmv  : Month without leading 0s
  4141.     %Dms  : Month string
  4142.     %Dma  : Abbreviated month string
  4143.     %Dy2f : 2-digit year with leading 0s
  4144.     %Dy2v : 2-digit year without leading 0s
  4145.     %Dy4f : 4-digit year with leading 0s
  4146.     %Dy4v : 4-digit year without leading 0s
  4147.     %Dys  : Scaliger year
  4148.     %Dj   : JD date
  4149.     %DJ   : MJD date
  4150.     %Dwn  : Weekday number (1-7)
  4151.     %Dws  : Weekday string
  4152.     %Dwa  : Abbreviated weekday string
  4153.     %DWf  : Weeknumber with leading 0s
  4154.     %DWv  : Weeknumber without leading 0s
  4155.     %DMf  : Age of the moon (0-30 ?) with leading 0s
  4156.     %DMv  : Age of the moon (0-30 ?) without leading 0s
  4157.  
  4158.    NOTES
  4159.     %DMf and %DMv are only pseudo implementations, a date can not be
  4160.     constructed with them.
  4161.  
  4162.     The date-string autodetection knows over 40 date-string formats:
  4163.  
  4164.     (yesterday|today|tomorrow)
  4165.     wdn
  4166.     wdn[,] mmm d[ (yy|yyyy)]
  4167.     wdn[,] d[.][ ]mmm[,][ ][(yy|yyyy)]
  4168.     wdn[,] d[.][ ]m[.][ ][(yy|yyyy)]
  4169.     mmm d[ yyyy]
  4170.     mmm/d[/(yy|yyyy)]
  4171.     mmm-d[-(yy|yyyy)]
  4172.     yyyy[-]Www[-]n
  4173.     yyyy(-|/)m(-|/)d
  4174.     yyyy(-|/)n[n[n]]
  4175.     yy[-]Www[-]n
  4176.     yy-nnn
  4177.     d. mmm [(yy|yyyy)]
  4178.     d.m.[(yy|yyyy)]
  4179.     d-mmm[-(yy|yyyy)]
  4180.     d-m[-yyyy]
  4181.                      Detection condition:
  4182.     yyyymmdd   | ddmmyyyy         (valid date test)
  4183.     jjjjjjj    | yyyynnn         (1723980 >= JD <= 2914672)
  4184.     JJJJJ
  4185.     JJJJJJ       | yymmdd         (MJD <= 514671)
  4186.     d-m-yy       | yy-m-d         (yy > 31 | valid date test)
  4187.     d/m[/yyyy] | m/d/yyyy         (valid date test)
  4188.     d/m/yy       | m/d/yy   | yy/m/d     (valid date test)
  4189.  
  4190.    BUGS
  4191.     No known bugs.
  4192.  
  4193.    SEE ALSO
  4194.     FormatDate()
  4195.  
  4196. Date/ParseTime                         Date/ParseTime
  4197.  
  4198.    NAME
  4199.     ParseTime -- Parses a time string (V33.282)
  4200.  
  4201.    SYNOPSIS
  4202.     pos = time_ParseTime(fmt,tstr,ChangeDay,ChangeHour,DST,hour,min,
  4203.        sec,zonemin,pfmt);
  4204.       d0             d0   d1     d2        d3       d4    a0   a1
  4205.        a2    a3    d5
  4206.  
  4207.     short time_ParseTime(const char *const fmt,
  4208.        const char *const tstr, time_ChangeDay ChangeDay,
  4209.        unsigned short ChangeHour, bool *const DST,
  4210.        unsigned short *const hour, unsigned short *const min,
  4211.        unsigned short *const sec, short *const zonemin,
  4212.        char *const pfmt);
  4213.  
  4214.    FUNCTION
  4215.     Parses the time from a string.
  4216.  
  4217.    INPUTS
  4218.     fmt        - Format template string
  4219.               (max. length = 46 characters)
  4220.     tstr        - Timestring to parse
  4221.     ChangeDay    - Normal day, winter to summer or summer to winter
  4222.               time change day.
  4223.     ChangeHour    - Hour of summer/winter time change
  4224.     DST        - Daylight saving status
  4225.     zonemin     - Time that was added to GMT time to get the local
  4226.               time zone (in minutes -779 to +779)
  4227.     pfmt        - Buffer for format template of parsed string or NULL
  4228.  
  4229.    RESULT
  4230.     pos    -  0 : The string has been parsed successfully.
  4231.           >0 : An error occured during parsing - subtract one to get
  4232.                the position of the error within the string.
  4233.           -1 : Parameter error (one or more pointers are pointing to
  4234.                NULL)
  4235.           -2 : Format template string to long
  4236.     hour    - Hour of the time that was parsed
  4237.     min    - Minute of the time that was parsed
  4238.     sec    - Second of the time that was parsed
  4239.     DST    - Daylight saving status
  4240.     zonemin - Time that was added to GMT time to get the local
  4241.           time zone (in minutes -779 to +779)
  4242.     pfmt    - Format template of parsed string
  4243.  
  4244.    EXAMPLE
  4245.     bool DST = false;
  4246.     unsigned short Hour,Min,Sec;
  4247.     short ZoneMin = 60,retval;
  4248.     char pfmtbuf[20];
  4249.     ...
  4250.     retval = time_ParseTime(NULL,"20:14",time_Normal,2,&DST,
  4251.        &Hour,&Min,&Sec,&ZoneMin,pfmtbuf);
  4252.     ...
  4253.  
  4254.    SYNTAX
  4255.     Syntax of Amiga compatible format template % strings:
  4256.     %q : Hour using 24-hour style
  4257.     %H : Hour using 24-hour style with leading 0s
  4258.     %Q : Hour using 12-hour style
  4259.     %I : Hour using 12-hour style with leading 0s
  4260.     %p : AM or PM strings
  4261.     %M : The number of minutes with leading 0s
  4262.     %S : Number of seconds with leadings 0s
  4263.     %R : Same as "%H:%M"
  4264.     %X : Same as "%H:%M:%S"
  4265.     %T : Same as "%H:%M:%S"
  4266.     %r : Same as "%I:%M:%S %p"
  4267.  
  4268.     Syntax of format template % commands:
  4269.     %Th1f  : 12 with leading 0s
  4270.     %Th1v  : 12 without leading 0s
  4271.     %Th2f  : 24 with leading 0s
  4272.     %Th2v  : 24 without leading 0s
  4273.     %Tpso  : a/p
  4274.     %Tpsu  : A/P
  4275.     %Tplo  : am/pm
  4276.     %Tplu  : AM/PM
  4277.     %Tmf   : with leading 0s
  4278.     %Tmv   : without leading 0s
  4279.     %Tsf   : with leading 0s
  4280.     %Tsv   : without leading 0s
  4281.     %Tj.   : starting with '.'
  4282.     %Tj,   : starting with ','
  4283.     %Tj0   : starting with '0.'
  4284.     %Tj1   : starting with '0,'
  4285.  
  4286.     %Tzh?? : hours only
  4287.     %Tzm?  : 0100
  4288.     %TzM?? : 01:00
  4289.     %Tz?z? : Use Z     for UTC
  4290.     %Tz?0? : Use +00 for UTC
  4291.     %Tz??f : use leading 0s
  4292.     %Tz??v : do not use leading 0s
  4293.  
  4294.     %Tc1   : Use DST for s->w switch
  4295.     %Tc2   : Use I/II for s->w switch
  4296.     %Tc3   : Use a/b for s->w switch (24h only) - on 12h falls back to 2
  4297.  
  4298.    NOTES
  4299.     None.
  4300.  
  4301.    BUGS
  4302.     No known bugs.
  4303.  
  4304.    SEE ALSO
  4305.     FormatTime()
  4306.  
  4307. Date/PreviousValidDate                 Date/PreviousValidDate
  4308.  
  4309.    NAME
  4310.     PreviousValidDate -- Returns the prev. valid date (V33.310)
  4311.  
  4312.    SYNOPSIS
  4313.     date_PreviousValidDate(day,month,year,dday,dmonth,dyear,calendar);
  4314.                  d0   d1  d2    a0    a1     a2    d3
  4315.  
  4316.     void date_PreviousValidDate(const unsigned short day,
  4317.         const unsigned short month, const long year,
  4318.         unsigned short *const dday, unsigned short *const dmonth,
  4319.         long *const dyear, const date_Calendars calendar);
  4320.  
  4321.     void date_PreviousValidDate(const unsigned short day,
  4322.         const unsigned short month, const long year,
  4323.         unsigned short &dday, unsigned short &dmonth, long &dyear,
  4324.         const date_Calendars calendar);
  4325.  
  4326.    FUNCTION
  4327.     Returns the previous valid date before a given one.
  4328.  
  4329.    INPUTS
  4330.     day      - Day of the date.
  4331.     month    - Month of the date.
  4332.     year     - Year of the date.
  4333.     calendar - Calendar system to use
  4334.  
  4335.    RESULT
  4336.     dday   - Day of the previous valid date
  4337.     dmonth - Month of the previous valid date
  4338.     dyear  - Year of the previous valid date
  4339.  
  4340.    EXAMPLE
  4341.     ...
  4342.     date_PreviousValidDate(29,2,2000,&day,&month,&year,date_Gregorian);
  4343.     ...
  4344.  
  4345.    NOTES
  4346.     None.
  4347.  
  4348.    BUGS
  4349.     None.
  4350.  
  4351.    SEE ALSO
  4352.     ValidDate(),PreviousValidJulianDate(),PreviousValidGregorianDate(),
  4353.     PreviousValidHeisDate(), NextValidDate()
  4354.  
  4355. Date/PreviousValidGregorianDate           Date/PreviousValidGregorianDate
  4356.  
  4357.    NAME
  4358.     PreviousValidGregorianDate -- Returns the prev. valid date (V33.236)
  4359.  
  4360.    SYNOPSIS
  4361.     date_PreviousValidGregorianDate(day,month,year,dday,dmonth,dyear);
  4362.                      d0   d1  d2    a0    a1     a2
  4363.  
  4364.     void date_PreviousValidGregorianDate(const unsigned short day,
  4365.        const unsigned short month, const long year,
  4366.        unsigned short *const dday, unsigned short *const dmonth,
  4367.        long *const dyear);
  4368.  
  4369.     void date_PreviousValidGregorianDate(const unsigned short day,
  4370.        const unsigned short month, const long year,
  4371.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  4372.  
  4373.    FUNCTION
  4374.     Returns the previous valid date before a given one.
  4375.  
  4376.    INPUTS
  4377.     day   - Day of the date.
  4378.     month - Month of the date.
  4379.     year  - Year of the date.
  4380.  
  4381.    RESULT
  4382.     dday   - Day of the previous valid date
  4383.     dmonth - Month of the previous valid date
  4384.     dyear  - Year of the previous valid date
  4385.  
  4386.    EXAMPLE
  4387.     ...
  4388.     date_PreviousValidGregorianDate(29,2,2000,&day,&month,&year);
  4389.     ...
  4390.  
  4391.    NOTES
  4392.     None.
  4393.  
  4394.    BUGS
  4395.     None.
  4396.  
  4397.    SEE ALSO
  4398.     ValidGregorianDate(),PreviousValidJulianDate(),
  4399.     PreviousValidHeisDate(), NextValidGregorianDate()
  4400.  
  4401. Date/PreviousValidHeisDate                Date/PreviousValidHeisDate
  4402.  
  4403.    NAME
  4404.     PreviousValidHeisDate -- Returns the previous valid date (V33.235)
  4405.  
  4406.    SYNOPSIS
  4407.     date_PreviousValidHeisDate(day,month,year,dday,dmonth,dyear);
  4408.                     d0     d1  d2    a0     a1    a2
  4409.  
  4410.     void date_PreviousValidHeisDate(const unsigned short day,
  4411.        const unsigned short month, const long year,
  4412.        unsigned short *const dday, unsigned short *const dmonth,
  4413.        long *const dyear);
  4414.  
  4415.     void date_PreviousValidHeisDate(const unsigned short day,
  4416.        const unsigned short month, const long year,
  4417.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  4418.  
  4419.    FUNCTION
  4420.     Returns the previous valid date before a given one.
  4421.  
  4422.    INPUTS
  4423.     day   - Day of the date.
  4424.     month - Month of the date.
  4425.     year  - Year of the date.
  4426.  
  4427.    RESULT
  4428.     dday   - Day of the previous valid date
  4429.     dmonth - Month of the previous valid date
  4430.     dyear  - Year of the previous valid date
  4431.  
  4432.    EXAMPLE
  4433.     ...
  4434.     date_PreviousValidHeisDate(29,2,2000,&day,&month,&year);
  4435.     ...
  4436.  
  4437.    NOTES
  4438.     None.
  4439.  
  4440.    BUGS
  4441.     None.
  4442.  
  4443.    SEE ALSO
  4444.     ValidHeisDate(),PreviousValidJulianDate(),
  4445.     PreviousValidGregorianDate(), NextValidHeisDate()
  4446.  
  4447. Date/PreviousValidJulianDate              Date/PreviousValidJulianDate
  4448.  
  4449.    NAME
  4450.     PreviousValidJulianDate -- Returns the prev. valid date (V33.236)
  4451.  
  4452.    SYNOPSIS
  4453.     date_PreviousValidJulianDate(day,month,year,dday,dmonth,dyear);
  4454.                       d0   d1  d2    a0    a1      a2
  4455.  
  4456.     void date_PreviousValidJulianDate(const unsigned short day,
  4457.        const unsigned short month, const long year,
  4458.        unsigned short *const dday, unsigned short *const dmonth,
  4459.        long *const dyear);
  4460.  
  4461.     void date_PreviousValidJulianDate(const unsigned short day,
  4462.        const unsigned short month, const long year,
  4463.        unsigned short &dday, unsigned short &dmonth, long &dyear);
  4464.  
  4465.    FUNCTION
  4466.     Returns the previous valid date before a given one.
  4467.  
  4468.    INPUTS
  4469.     day   - Day of the date.
  4470.     month - Month of the date.
  4471.     year  - Year of the date.
  4472.  
  4473.    RESULT
  4474.     dday   - Day of the previous valid date
  4475.     dmonth - Month of the previous valid date
  4476.     dyear  - Year of the previous valid date
  4477.  
  4478.    EXAMPLE
  4479.     ...
  4480.     date_PreviousValidJulianDate(29,2,2000,&day,&month,&year);
  4481.     ...
  4482.  
  4483.    NOTES
  4484.     None.
  4485.  
  4486.    BUGS
  4487.     None.
  4488.  
  4489.    SEE ALSO
  4490.     ValidJulianDate(),PreviousValidGregorianDate(),
  4491.     PreviousValidHeisDate(), NextValidJulianDate()
  4492.  
  4493. Date/RangeDiff                         Date/RangeDiff
  4494.  
  4495.    NAME
  4496.     RangeDiff -- Calculates the range between 2 dates. (V33.310)
  4497.  
  4498.    SYNOPSIS
  4499.     date_RangeDiff(day1,month1,year1,day2,month2,year2,days,
  4500.         months,years,calendar);
  4501.              d0    d1    d2    d3     d4    d5    a0
  4502.           a1     a2    d6
  4503.  
  4504.     void date_RangeDiff(unsigned short day1,
  4505.         unsigned short month1, long year1, unsigned short day2,
  4506.         unsigned short month2, long year2, short *const days,
  4507.         short *const months, long *const years,
  4508.         const date_Calendars calendar);
  4509.  
  4510.     void date_RangeDiff(unsigned short day1,
  4511.         unsigned short month1, long year1, unsigned short day2,
  4512.         unsigned short month2, long year2, short &days, short &months,
  4513.         long &years, const date_Calendars calendar);
  4514.  
  4515.    FUNCTION
  4516.     RangeDiff gives you back the number of days, months and
  4517.     years between two specified dates.
  4518.  
  4519.    INPUTS
  4520.     day1     - day of the first date
  4521.     month1   - month of the first date
  4522.     year1    - year of the first date
  4523.     day2     - day of the second date
  4524.     month2   - month of the second month
  4525.     year2    - year of the second date
  4526.     calendar - Calendar system to use
  4527.  
  4528.    RESULT
  4529.     days   - The number of days between the two dates
  4530.          (positive if date1 <= date2).
  4531.     months - The number of months between the two dates
  4532.          (positive if date1 <= date2).
  4533.     years  - The number of years between the two dates
  4534.          (positive if date1 <= date2).
  4535.  
  4536.    EXAMPLE
  4537.     short days,months;
  4538.     long years;
  4539.     ...
  4540.     date_RangeDiff(18,9,1970,25,1,1998,&days,&months,&years,
  4541.         date_Gregorian);
  4542.     printf("Age of Kai Hofmann is : %ld years, %hd months, %hd days\n",
  4543.        years,months,days);
  4544.     ...
  4545.  
  4546.    NOTES
  4547.     It is better only to use this function for years from 8 to 8000!
  4548.  
  4549.    BUGS
  4550.     If you use one of the dates 5.10.1582 to 14.10.1582 you will get an
  4551.     incorrect output because these days don't exist, except in the
  4552.     Julian calendar!
  4553.  
  4554.    SEE ALSO
  4555.     JulianRangeDiff(),GregorianRangeDiff(),HeisRangeDiff()
  4556.  
  4557. Date/ScaligerYearToG                      Date/ScaligerYearToG
  4558.  
  4559.    NAME
  4560.     ScaligerYearToG -- Returns the Scaliger year as Gregorian year. (V33)
  4561.  
  4562.    SYNOPSIS
  4563.     year = date_ScaligerYearToG(syear);
  4564.      d0                  d0
  4565.  
  4566.     long date_ScaligerYearToG(const unsigned long syear);
  4567.  
  4568.    FUNCTION
  4569.     Returns the Gregorian year of a Scaliger year.
  4570.  
  4571.    INPUTS
  4572.     syear      - Scaliger year
  4573.  
  4574.    RESULT
  4575.     year - The Gregorian year
  4576.  
  4577.    EXAMPLE
  4578.     ...
  4579.     year = date_ScaligerYearToG(6400);
  4580.     ...
  4581.  
  4582.    NOTES
  4583.     It is better to use this function only from 4707 to 7981!
  4584.  
  4585.    BUGS
  4586.     unknown.
  4587.  
  4588.    SEE ALSO
  4589.     ScaligerYearToJ(),ScaligerYearToH()
  4590.  
  4591. Date/ScaligerYearToH                      Date/ScaligerYearToH
  4592.  
  4593.    NAME
  4594.     ScaligerYearToH -- Returns the Scaliger year as Heis year. (V33)
  4595.  
  4596.    SYNOPSIS
  4597.     year = date_ScaligerYearToH(syear);
  4598.      d0                  d0
  4599.  
  4600.     long date_ScaligerYearToH(const unsigned long syear);
  4601.  
  4602.    FUNCTION
  4603.     Returns the Heis year of a Scaliger year.
  4604.  
  4605.    INPUTS
  4606.     syear      - Scaliger year
  4607.  
  4608.    RESULT
  4609.     year - The Heis year
  4610.  
  4611.    EXAMPLE
  4612.     ...
  4613.     year = date_ScaligerYearToH(7000);
  4614.     ...
  4615.  
  4616.    NOTES
  4617.     It is better to use this function only from 4707 to 7981!
  4618.  
  4619.    BUGS
  4620.     unknown.
  4621.  
  4622.    SEE ALSO
  4623.     ScaligerYearToJ(),ScaligerYearToG()
  4624.  
  4625. Date/ScaligerYearToJ                      Date/ScaligerYearToJ
  4626.  
  4627.    NAME
  4628.     ScaligerYearToJ -- Returns the Scaliger year as Julian year. (V33)
  4629.  
  4630.    SYNOPSIS
  4631.     year = date_ScaligerYearToJ(syear);
  4632.      d0                  d0
  4633.  
  4634.     long date_ScaligerYearToJ(const unsigned long syear);
  4635.  
  4636.    FUNCTION
  4637.     Returns the Julian year of a Scaliger year.
  4638.  
  4639.    INPUTS
  4640.     syear      - Scaliger year
  4641.  
  4642.    RESULT
  4643.     year - The Julian year
  4644.  
  4645.    EXAMPLE
  4646.     ...
  4647.     year = date_ScaligerYearToJ(4800);
  4648.     ...
  4649.  
  4650.    NOTES
  4651.     It is better to use this function only from 4707 to 6295!
  4652.  
  4653.    BUGS
  4654.     unknown.
  4655.  
  4656.    SEE ALSO
  4657.     ScaligerYearToG(),ScaligerYearToH()
  4658.  
  4659. Date/ScaligerYearToYear                   Date/ScaligerYearToYear
  4660.  
  4661.    NAME
  4662.     ScaligerYearToG -- Returns the Scaliger year as  year. (V33.310)
  4663.  
  4664.    SYNOPSIS
  4665.     year = date_ScaligerYearToG(syear,calendar);
  4666.      d0                  d0    d1
  4667.  
  4668.     long date_ScaligerYearToG(const unsigned long syear,
  4669.         const date_Calendars calendar);
  4670.  
  4671.    FUNCTION
  4672.     Returns the  year of a Scaliger year.
  4673.  
  4674.    INPUTS
  4675.     syear     - Scaliger year
  4676.     calendar - Calendar system to use
  4677.  
  4678.    RESULT
  4679.     year - The  year
  4680.  
  4681.    EXAMPLE
  4682.     ...
  4683.     year = date_ScaligerYearToG(6400,date_Gregorian);
  4684.     ...
  4685.  
  4686.    NOTES
  4687.     It is better to use this function only from 4707 to 7981!
  4688.  
  4689.    BUGS
  4690.     unknown.
  4691.  
  4692.    SEE ALSO
  4693.     ScaligerYearToJ(),ScaligerYearToG(),ScaligerYearToH()
  4694.  
  4695. Date/SecToTime                         Date/SecToTime
  4696.  
  4697.    NAME
  4698.     SecToTime -- Returns the time from seconds (V33)
  4699.  
  4700.    SYNOPSIS
  4701.     time_SecToTime(secs,hour,min,sec);
  4702.             d0   a0  a1  a2
  4703.  
  4704.     void time_SecToTime(unsigned long secs, unsigned short *const hour,
  4705.         unsigned short *const min, unsigned short *const sec);
  4706.  
  4707.     void time_SecToTime(unsigned long secs, unsigned short &hour,
  4708.         unsigned short &min, unsigned short &sec);
  4709.  
  4710.    FUNCTION
  4711.     Gives you back the time from the specified seconds
  4712.  
  4713.    INPUTS
  4714.     secs - Time in seconds
  4715.  
  4716.    RESULT
  4717.     hour - hours (0-23)
  4718.     min  - minutes (0-59)
  4719.     sec  - seconds (0-59)
  4720.  
  4721.    EXAMPLE
  4722.     ...
  4723.     time_SecToTime(76860,&hour,&min,&sec);
  4724.     ...
  4725.  
  4726.    NOTES
  4727.     Don't forget to convert 24h time to AM/PM time if needed!
  4728.  
  4729.    BUGS
  4730.     No errorcheck, if you use a valid time
  4731.  
  4732.    SEE ALSO
  4733.     TimeToSec()
  4734.  
  4735. Date/SetCountry                           Date/SetCountry
  4736.  
  4737.    NAME
  4738.     SetCountry -- Sets the country defaults for the date lib. (V33.140)
  4739.  
  4740.    SYNOPSIS
  4741.     date_SetCountry(country);
  4742.                d0
  4743.  
  4744.     void date_SetCountry(const date_Countries country);
  4745.  
  4746.    FUNCTION
  4747.     SetCountry sets the defaults for your country.
  4748.     Like: correct start of Gregorian calendar.
  4749.  
  4750.    INPUTS
  4751.     country - Country to set.
  4752.  
  4753.    RESULT
  4754.     None.
  4755.  
  4756.    EXAMPLE
  4757.     ...
  4758.     date_SetCountry(unknown);
  4759.     ...
  4760.  
  4761.    NOTES
  4762.     Will *not* work correct if something other than 'unknown' is set
  4763.     for the moment!
  4764.  
  4765.    BUGS
  4766.     None.
  4767.  
  4768.    SEE ALSO
  4769.     SetFirstWeekday()
  4770.  
  4771. Date/SetFirstWeekday                      Date/SetFirstWeekday
  4772.  
  4773.    NAME
  4774.     SetFirstWeekday -- Sets the FirstWeekday default (V33.165)
  4775.  
  4776.    SYNOPSIS
  4777.     date_SetFirstWeekday(weekday);
  4778.                 d0
  4779.  
  4780.     void date_SetFirstWeekday(const date_Weekdays weekday);
  4781.  
  4782.    FUNCTION
  4783.     SetFirstWeekday sets the weekday with which a week starts.
  4784.     Default is: Monday
  4785.  
  4786.    INPUTS
  4787.     weekday - Weekday to set.
  4788.  
  4789.    RESULT
  4790.     None.
  4791.  
  4792.    EXAMPLE
  4793.     ...
  4794.     date_SetFirstWeekday(Sunday);
  4795.     ...
  4796.  
  4797.    NOTES
  4798.     dayerr can not be set!
  4799.  
  4800.    BUGS
  4801.     None.
  4802.  
  4803.    SEE ALSO
  4804.     SetCountry(),JulianWeek(),GregorianWeek(),HeisWeek()
  4805.  
  4806. Date/SupplementCentury                 Date/SupplementCentury
  4807.  
  4808.    NAME
  4809.     SupplementCentury -- Add century for a 2 digit year (V33.165)
  4810.  
  4811.    SYNOPSIS
  4812.     year = date_SupplementCentury(year,actualyear);
  4813.      d0                  d0       d1
  4814.  
  4815.     long date_SupplementCentury(unsigned short year, long actualyear);
  4816.  
  4817.    FUNCTION
  4818.     Supplements the century for a two digit year by comparing it to the
  4819.     actual year, which must be a four digit year.
  4820.     This will be done by using the 'sliding window' technic.
  4821.  
  4822.    INPUTS
  4823.     year       - Two digit year which should be supplemented to four
  4824.              digits.
  4825.     actualyear - The actual year as a four digit year.
  4826.  
  4827.    RESULT
  4828.     year - The year known by a four digit format.
  4829.  
  4830.    EXAMPLE
  4831.     ...
  4832.     printf("%ld\n",SupplementCentury(01,1996));
  4833.     ...
  4834.  
  4835.    NOTES
  4836.     None.
  4837.  
  4838.    BUGS
  4839.     No known bugs.
  4840.  
  4841.    SEE ALSO
  4842.  
  4843.  
  4844. Date/SYearToJD                         Date/SYearToJD
  4845.  
  4846.    NAME
  4847.     SYearToJD -- Calcs the JD from a Scaliger year. (V33.310)
  4848.  
  4849.    SYNOPSIS
  4850.     jd = date_SYearToJD(syear,calendar);
  4851.     d0              d0     d1
  4852.  
  4853.     unsigned long date_SYearToJD(const unsigned long syear,
  4854.         const date_Calendars calendar);
  4855.  
  4856.    FUNCTION
  4857.     Returns the Julianday of a Scaliger year.
  4858.  
  4859.    INPUTS
  4860.     syear     - Scaliger year
  4861.     calendar - Calendar system to use
  4862.  
  4863.    RESULT
  4864.     jd - The Julianday
  4865.  
  4866.    EXAMPLE
  4867.     ...
  4868.     jd = date_SYearToJD(4800,date_Gregorian);
  4869.     ...
  4870.  
  4871.    NOTES
  4872.     It is better to use this function only from 4707 to 7981!
  4873.  
  4874.    BUGS
  4875.     unknown.
  4876.  
  4877.    SEE ALSO
  4878.     JSYearToJD(),GSYearToJD(),HSYearToJD()
  4879.  
  4880. Date/TimeDiff                             Date/TimeDiff
  4881.  
  4882.    NAME
  4883.     TimeDiff -- Returns the difference in seconds (V33)
  4884.  
  4885.    SYNOPSIS
  4886.     secs = time_TimeDiff(hour1,min1,sec1,hour2,min2,sec2);
  4887.      d0              d0    d1     d2   d3    d4     d5
  4888.  
  4889.     long time_TimeDiff(const unsigned short hour1,
  4890.         const unsigned short min1, const unsigned short sec1,
  4891.         const unsigned short hour2, const unsigned short min2,
  4892.         const unsigned short sec2);
  4893.  
  4894.    FUNCTION
  4895.     Gives you back the difference between the first and the second time
  4896.     in seconds.
  4897.  
  4898.    INPUTS
  4899.     hour1 - hours of the first time
  4900.     min1  - minutes of the first time
  4901.     sec1  - seconds of the first time
  4902.     hour2 - hours of the second time
  4903.     min2  - minutes of the second time
  4904.     sec2  - seconds of the second time
  4905.  
  4906.    RESULT
  4907.     secs - The difference betwen time1 and time1 in seconds.
  4908.  
  4909.    EXAMPLE
  4910.     ...
  4911.     secs = time_TimeDiff(21,15,00,22,0,0);
  4912.     ...
  4913.  
  4914.    NOTES
  4915.     Don't forget to convert AM/PM time to 24h time!
  4916.     use SecToTime() to convert the seconds back to a hour,min,secs
  4917.     format!
  4918.  
  4919.    BUGS
  4920.     No errorcheck, if you use a valid time
  4921.  
  4922.    SEE ALSO
  4923.     SecToTime(),TimeToSec()
  4924.  
  4925. Date/TimeToJD                             Date/TimeToJD
  4926.  
  4927.    NAME
  4928.     TimeToJD -- Returns the JD for a time. (V33)
  4929.  
  4930.    SYNOPSIS
  4931.     jd = time_TimeToJD(hour,min,sec);
  4932.     d0            d0     d1  d2
  4933.  
  4934.     float time_TimeToJD(const unsigned short hour,
  4935.         const unsigned short min, const unsigned short sec);
  4936.  
  4937.    FUNCTION
  4938.     Returns the JD for a specified time.
  4939.  
  4940.    INPUTS
  4941.     hour - hour of the time to convert
  4942.     min  - minute of the time to convert
  4943.     sec  - sec. of the time to convert
  4944.  
  4945.    RESULT
  4946.     jd - This is the JD time
  4947.  
  4948.    EXAMPLE
  4949.     ...
  4950.     jd = time_TimeToJD(16,33,0);
  4951.     ...
  4952.  
  4953.    NOTES
  4954.     none
  4955.  
  4956.    BUGS
  4957.     There is no check, if the specified time is a valid time!
  4958.  
  4959.    SEE ALSO
  4960.     JDToTime()
  4961.  
  4962. Date/TimeToNum                         Date/TimeToNum
  4963.  
  4964.    NAME
  4965.     TimeToNum -- Returns the time in a numeric format. (V33.250)
  4966.  
  4967.    SYNOPSIS
  4968.     num = time_TimeToNum(hour,min,sec);
  4969.     d0              d0   d1  d2
  4970.  
  4971.     unsigned long time_TimeToNum(const unsigned short hour,
  4972.         const unsigned short min, const unsigned short sec);
  4973.  
  4974.    FUNCTION
  4975.     Returns the time in a numeric format.
  4976.  
  4977.    INPUTS
  4978.     hour - hour of the time to convert
  4979.     min  - minute of the time to convert
  4980.     sec  - second of the time to convert
  4981.  
  4982.    RESULT
  4983.     num - Numeric time format:
  4984.           (hour*100+min)*100+sec
  4985.  
  4986.    EXAMPLE
  4987.     ...
  4988.     num = time_TimeToNum(12,31,0);
  4989.     ...
  4990.  
  4991.    NOTES
  4992.     none
  4993.  
  4994.    BUGS
  4995.     There is no check, if the specified time is a valid time!
  4996.  
  4997.    SEE ALSO
  4998.     NumToTime()
  4999.  
  5000. Date/TimeToSec                         Date/TimeToSec
  5001.  
  5002.    NAME
  5003.     TimeToSec -- Returns the time in seconds (V33)
  5004.  
  5005.    SYNOPSIS
  5006.     secs = time_TimeToSec(hour,min,sec);
  5007.      d0               d0   d1    d2
  5008.  
  5009.     unsigned long time_TimeToSec(const unsigned short hour,
  5010.         const unsigned short min, const unsigned short sec);
  5011.  
  5012.    FUNCTION
  5013.     Gives you back the time in seconds
  5014.  
  5015.    INPUTS
  5016.     hour - hours you want (0-23)
  5017.     min  - minutes you want (0-59)
  5018.     sec  - seconds you want (0-59)
  5019.  
  5020.    RESULT
  5021.     secs - Time in seconds
  5022.  
  5023.    EXAMPLE
  5024.     ...
  5025.     secs = time_TimeToSec(21,15,00);
  5026.     ...
  5027.  
  5028.    NOTES
  5029.     Don't forget to convert AM/PM time to 24h time!
  5030.  
  5031.    BUGS
  5032.     No errorcheck, if you use a valid time
  5033.  
  5034.    SEE ALSO
  5035.     SecToTime()
  5036.  
  5037. Date/TimeZoneFactor                       Date/TimeZoneFactor
  5038.  
  5039.    NAME
  5040.     TimeZoneFactor -- Returns the value you have to add to GMT time (V33)
  5041.  
  5042.    SYNOPSIS
  5043.     addhours = time_TimeZoneFactor(degrees);
  5044.        d0                 d0
  5045.  
  5046.     short time_TimeZoneFactor(const short degree);
  5047.  
  5048.    FUNCTION
  5049.     This gives you the hours you have to add to GMT time,
  5050.     specified on the fact, that a timezone is 15 degrees
  5051.     and that GMT is centered on 0 degrees!
  5052.  
  5053.    INPUTS
  5054.     degrees - Position of timezone you live in
  5055.     (from -180 east to +180 west)
  5056.  
  5057.    RESULT
  5058.     addhours - Time to add to GMT time to get your local time zone
  5059.         (-12 to +12)
  5060.  
  5061.    EXAMPLE
  5062.     ...
  5063.     addhours = time_TimeZoneFactor(-8);
  5064.     ...
  5065.  
  5066.    NOTES
  5067.     none
  5068.  
  5069.    BUGS
  5070.     No errorcheck, if you put in valid degrees (-180 to +180)
  5071.     Only full degrees are supportet, keep sure that you
  5072.     round in the right way for 0.x degree places
  5073.     I am not sure about the correct +/- behaviour!!!
  5074.  
  5075.    SEE ALSO
  5076.  
  5077.  
  5078. Date/ValidDate                         Date/ValidDate
  5079.  
  5080.    NAME
  5081.     ValidDate -- Checks if the date is a valid date (V33.310)
  5082.  
  5083.    SYNOPSIS
  5084.     valid = date_ValidDate(day,month,year,calendar);
  5085.       d0            d0   d1  d2     d3
  5086.  
  5087.     bool date_ValidDate(const unsigned short day,
  5088.         const unsigned short month, const long year,
  5089.         const date_Calendars calendar);
  5090.  
  5091.    FUNCTION
  5092.     ValidDate checks if the date is valid.
  5093.  
  5094.    INPUTS
  5095.     day      - Day of the date.
  5096.     month    - Month of the date.
  5097.     year     - Year of the date.
  5098.     calendar - Calendar system to use
  5099.  
  5100.    RESULT
  5101.     valid - true  : The date is ok.
  5102.         false : This is not a correct date!
  5103.  
  5104.    EXAMPLE
  5105.     ...
  5106.     if (date_ValidDate(29,2,2000,date_Gregorian))
  5107.       printf("ok\n");
  5108.     else
  5109.       printf("wrong date!!!\n");
  5110.     ...
  5111.  
  5112.    NOTES
  5113.     None.
  5114.  
  5115.    BUGS
  5116.     None.
  5117.  
  5118.    SEE ALSO
  5119.     ValidTime(),ValidJulianDate(),ValidGregorianDate(),ValidHeisDate()
  5120.  
  5121. Date/ValidGregorianDate                   Date/ValidGregorianDate
  5122.  
  5123.    NAME
  5124.     ValidGregorianDate -- Checks if the date is a valid date (V33.135)
  5125.  
  5126.    SYNOPSIS
  5127.     valid = date_ValidGregorianDate(day,month,year);
  5128.       d0                d0   d1  d2
  5129.  
  5130.     bool date_ValidGregorianDate(const unsigned short day,
  5131.         const unsigned short month, const long year);
  5132.  
  5133.    FUNCTION
  5134.     ValidGregorianDate checks if the date is valid.
  5135.  
  5136.    INPUTS
  5137.     day   - Day of the date.
  5138.     month - Month of the date.
  5139.     year  - Year of the date.
  5140.  
  5141.    RESULT
  5142.     valid - true  : The date is ok.
  5143.         false : This is not a correct date!
  5144.  
  5145.    EXAMPLE
  5146.     ...
  5147.     if (date_ValidGregorianDate(29,2,2000))
  5148.       printf("ok\n");
  5149.     else
  5150.       printf("wrong date!!!\n");
  5151.     ...
  5152.  
  5153.    NOTES
  5154.     None.
  5155.  
  5156.    BUGS
  5157.     None.
  5158.  
  5159.    SEE ALSO
  5160.     ValidTime(),ValidJulianDate(),ValidHeisDate()
  5161.  
  5162. Date/ValidHeisDate                        Date/ValidHeisDate
  5163.  
  5164.    NAME
  5165.     ValidHeisDate -- Checks if the date is a valid date (V33.135)
  5166.  
  5167.    SYNOPSIS
  5168.     valid = date_ValidHeisDate(day,month,year);
  5169.       d0               d0    d1  d2
  5170.  
  5171.     bool date_ValidHeisDate(const unsigned short day,
  5172.         const unsigned short month, const long year);
  5173.  
  5174.    FUNCTION
  5175.     ValidHeisDate checks if the date is valid.
  5176.  
  5177.    INPUTS
  5178.     day   - Day of the date.
  5179.     month - Month of the date.
  5180.     year  - Year of the date.
  5181.  
  5182.    RESULT
  5183.     valid - true  : The date is ok.
  5184.         false : This is not a correct date!
  5185.  
  5186.    EXAMPLE
  5187.     ...
  5188.     if (date_ValidHeisDate(29,2,2000))
  5189.       printf("ok\n");
  5190.     else
  5191.       printf("wrong date!!!\n");
  5192.     ...
  5193.  
  5194.    NOTES
  5195.     None.
  5196.  
  5197.    BUGS
  5198.     None.
  5199.  
  5200.    SEE ALSO
  5201.     ValidTime(),ValidJulianDate(),ValidGregorianDate()
  5202.  
  5203. Date/ValidJulianDate                      Date/ValidJulianDate
  5204.  
  5205.    NAME
  5206.     ValidJulianDate -- Checks if the date is a valid date (V33.135)
  5207.  
  5208.    SYNOPSIS
  5209.     valid = date_ValidJulianDate(day,month,year);
  5210.       d0                 d0   d1  d2
  5211.  
  5212.     bool date_ValidJulianDate(const unsigned short day,
  5213.         const unsigned short month, const long year);
  5214.  
  5215.    FUNCTION
  5216.     ValidJulianDate checks if the date is valid.
  5217.  
  5218.    INPUTS
  5219.     day   - Day of the date.
  5220.     month - Month of the date.
  5221.     year  - Year of the date.
  5222.  
  5223.    RESULT
  5224.     valid - true  : The date is ok.
  5225.         false : This is not a correct date!
  5226.  
  5227.    EXAMPLE
  5228.     ...
  5229.     if (date_ValidJulianDate(29,2,2000))
  5230.       printf("ok\n");
  5231.     else
  5232.       printf("wrong date!!!\n");
  5233.     ...
  5234.  
  5235.    NOTES
  5236.     None.
  5237.  
  5238.    BUGS
  5239.     None.
  5240.  
  5241.    SEE ALSO
  5242.     ValidTime(),ValidGregorianDate(),ValidHeisDate()
  5243.  
  5244. Date/ValidTime                         Date/ValidTime
  5245.  
  5246.    NAME
  5247.     ValidTime -- Checks if the time is a valid 24h-format time (V33.135)
  5248.  
  5249.    SYNOPSIS
  5250.     valid = time_ValidTime(hour,min,sec);
  5251.       d0            d0   d1  d2
  5252.  
  5253.     bool time_ValidTime(const unsigned short hour,
  5254.         const unsigned short min, const unsigned short sec);
  5255.  
  5256.    FUNCTION
  5257.     ValidTime checks if the time (24h format only) is valid.
  5258.  
  5259.    INPUTS
  5260.     hour - Hour of the time.
  5261.     min  - Minute of the time.
  5262.     sec  - Second of the time.
  5263.  
  5264.    RESULT
  5265.     valid - true  : The time is ok.
  5266.         false : This is not a correct time!
  5267.  
  5268.    EXAMPLE
  5269.     ...
  5270.     if (time_ValidTime(25,0,0))
  5271.       printf("ok\n");
  5272.     else
  5273.       printf("wrong time!!!\n");
  5274.     ...
  5275.  
  5276.    NOTES
  5277.     None.
  5278.  
  5279.    BUGS
  5280.     None.
  5281.  
  5282.    SEE ALSO
  5283.     ValidJulianDate(),ValidGregorianDate(),ValidHeisDate()
  5284.  
  5285. Date/Week                                 Date/Week
  5286.  
  5287.    NAME
  5288.     Week -- Gets the weeknumber for a specified date. (V33.310)
  5289.  
  5290.    SYNOPSIS
  5291.     weeknr = date_Week(day,month,year,calendar);
  5292.       d0           d0   d1   d2     d3
  5293.  
  5294.     unsigned short date_Week(const unsigned short day,
  5295.         const unsigned short month, const long year,
  5296.         const date_Calendars calendar);
  5297.  
  5298.    FUNCTION
  5299.     Week gets the number of the week for a specified date.
  5300.  
  5301.    INPUTS
  5302.     day      - day of the date
  5303.     month    - month of the date
  5304.     year     - year of the date
  5305.     calendar - Calendar system to use
  5306.  
  5307.    RESULT
  5308.     week - This is the number of the week the specified date lies in.
  5309.         If the first day in a new year is a Friday, Saturday or
  5310.         Sunday, this would be the last week of the last year!
  5311.         If the 29.12. is a Monday, the 30.12. is a Monday or a Tuesday,
  5312.         the 31.12. is a Monday, Tuesday or a Wednesday this is the
  5313.         first week of the next year!
  5314.  
  5315.    EXAMPLE
  5316.     ...
  5317.     weeknr = date_Week(4,10,1582,date_Gregorian);
  5318.     ...
  5319.  
  5320.    NOTES
  5321.     It is better only to use this function for years from 8 to 3200!
  5322.  
  5323.    BUGS
  5324.     For years < 0 errors could occur.
  5325.  
  5326.    SEE ALSO
  5327.     JulianWeek(),GregorianWeek(),HeisWeek(),SetFirstWeekday()
  5328.  
  5329. Date/Weekday                              Date/Weekday
  5330.  
  5331.    NAME
  5332.     Weekday -- Gets the weekday of a specified date. (V33.310)
  5333.  
  5334.    SYNOPSIS
  5335.     weekday = date_Weekday(day,month,year,calendar);
  5336.       d0            d0   d1   d2    d3
  5337.  
  5338.     date_Weekdays date_Weekday(const unsigned short day,
  5339.         unsigned short month, long year, const date_Calendars calendar);
  5340.  
  5341.    FUNCTION
  5342.     Weekday gets the weekday for a specified date.
  5343.  
  5344.    INPUTS
  5345.     day      - day of the date
  5346.     month    - month of the date
  5347.     year     - year of the date
  5348.     calendar - Calendar system to use
  5349.  
  5350.    RESULT
  5351.     weekday - This result is of type:
  5352.         date_Weekdays = {date_dayerr,date_Monday,date_Tuesday,
  5353.                  date_Wednesday,date_Thursday,date_Friday,
  5354.                  date_Saturday,date_Sunday};
  5355.         dayerr will show you, that an error occurs!
  5356.  
  5357.    EXAMPLE
  5358.     ...
  5359.     weekday = date_Weekday(22,1,1994,date_Gregorian);
  5360.     if (weekday == dayerr)
  5361.      {
  5362.       ...
  5363.      }
  5364.     ...
  5365.  
  5366.    NOTES
  5367.     It is better only to use this function for years from 8 to 3200!
  5368.     In this version dayerr will only occur for the lost days :)
  5369.  
  5370.    BUGS
  5371.     It's not possible to use years < 0 (for more see JulianWeekday()).
  5372.  
  5373.    SEE ALSO
  5374.     JulianWeekday(),GregorianWeekday(),HeisWeekday()
  5375.  
  5376. Date/WeekdayShortText                     Date/WeekdayShortText
  5377.  
  5378.    NAME
  5379.     WeekdayShortText -- Get the weekday as short text string. (V33.092)
  5380.  
  5381.    SYNOPSIS
  5382.     maxlen = date_WeekdayShortText(wday,wtext,lang);
  5383.     d0                d0   a0    d1
  5384.  
  5385.     unsigned short date_WeekdayShortText(const date_Weekdays wday,
  5386.         char *const wtext, const date_Languages lang);
  5387.  
  5388.    FUNCTION
  5389.     This function gets the short text string for the weekday-number.
  5390.  
  5391.    INPUTS
  5392.     wday  - Weekday to transform into a string.
  5393.     wtext - Pointer to a string to fill in the short weekday-text.
  5394.     lang  - Language for which you want the short weekday-text.
  5395.  
  5396.    RESULT
  5397.     maxlen - Maximum possible length for the weekday-string, this should
  5398.         help you if you want to justify the string right or if you
  5399.         want to center it! (Normally it's two or three!)
  5400.         0 indicates an error!
  5401.  
  5402.    EXAMPLE
  5403.     ...
  5404.     char wtxt[3];
  5405.     ...
  5406.     maxlen = date_WeekdayShortText(Monday,&wtxt,English);
  5407.     ...
  5408.  
  5409.    NOTES
  5410.     Languages:
  5411.     Locale      : This is an Amiga >= OS2.1 only feature, for <= OS2.0
  5412.             and other systems it will return English text!
  5413.  
  5414.    BUGS
  5415.     In this version there is no check, if there is enough space in
  5416.     wtext!
  5417.  
  5418.    SEE ALSO
  5419.     WeekdayText(),MonthText(),MonthShortText()
  5420.  
  5421. Date/WeekdayText                          Date/WeekdayText
  5422.  
  5423.    NAME
  5424.     WeekdayText -- Get the weekday as text string. (V33.091)
  5425.  
  5426.    SYNOPSIS
  5427.     maxlen = date_WeekdayText(wday,wtext,lang);
  5428.       d0               d0    a0    d1
  5429.  
  5430.     unsigned short date_WeekdayText(const date_Weekdays wday,
  5431.         char *const wtext, const date_Languages lang);
  5432.  
  5433.    FUNCTION
  5434.     This function gets the text string for the weekday-number.
  5435.  
  5436.    INPUTS
  5437.     wday  - Weekday to transform into a string.
  5438.     wtext - Pointer to a string to fill in the weekday-text.
  5439.     lang  - Language for which you want the weekday-text.
  5440.  
  5441.    RESULT
  5442.     maxlen - Maximum possible length for the weekday-string, this should
  5443.         help you if you want to justify the string right or if you
  5444.         want to center it!
  5445.         0 indicates an error!
  5446.  
  5447.    EXAMPLE
  5448.     ...
  5449.     char wtxt[20];
  5450.     ...
  5451.     maxlen = date_WeekdayText(Monday,&wtxt,English);
  5452.     ...
  5453.  
  5454.    NOTES
  5455.     Languages:
  5456.     Locale      : This is an Amiga >= OS2.1 only feature, for <= OS2.0
  5457.             and other systems it will return English text!
  5458.  
  5459.    BUGS
  5460.     In this version there is no check, if there is enough space in
  5461.     wtext!
  5462.  
  5463.    SEE ALSO
  5464.     MonthText(),WeekdayShortText(),MonthShortText()
  5465.  
  5466. Date/WWtoDM                               Date/WWtoDM
  5467.  
  5468.    NAME
  5469.     WWtoDM -- Convert Weekday,Week to Day,Month. (V33.310)
  5470.  
  5471.    SYNOPSIS
  5472.     date_WWtoDM(weekday,week,year,dday,dmonth,dyear,calendar);
  5473.             d0    d1   d2    a0    a1     a2    d3
  5474.  
  5475.     void date_WWtoDM(const date_Weekdays weekday,
  5476.        const unsigned short week, const long year,
  5477.        unsigned short *const dday, unsigned short *const dmonth,
  5478.        long *const dyear, const date_Calendars calendar);
  5479.  
  5480.     void date_WWtoDM(const date_Weekdays weekday,
  5481.        const unsigned short week, const long year,
  5482.        unsigned short &dday, unsigned short &dmonth,
  5483.        long &dyear, const date_Calendars calendar);
  5484.  
  5485.    FUNCTION
  5486.     Converts weekday,week to day,month.
  5487.  
  5488.    INPUTS
  5489.     weekday  - weekday of the date to convert
  5490.     week     - week of the date to convert
  5491.     year     - year of the date to convert
  5492.     calendar - Calendar system to use
  5493.  
  5494.    RESULT
  5495.     day   - day of the converted date
  5496.     month - month of the converted date
  5497.     year  - year of the converted date
  5498.  
  5499.    EXAMPLE
  5500.     unsigned short day,month;
  5501.     long year;
  5502.     ...
  5503.     date_WWtoDM(date_Thursday,14,1997,&day,&month,&year,date_Gregorian);
  5504.     /* 1997-04-03 */
  5505.     ...
  5506.  
  5507.    NOTES
  5508.     It is better to use this function only from 8 to 8000!
  5509.     Be careful, the resulting year might be different from the input
  5510.     year!
  5511.  
  5512.    BUGS
  5513.     unknown.
  5514.  
  5515.    SEE ALSO
  5516.     JulianWWtoDM(),GregorianWWtoDM(),HeisWWtoDM()
  5517.  
  5518. Date/YearDays                             Date/YearDays
  5519.  
  5520.    NAME
  5521.     YearDays -- Gives back the number of days in a year. (V33.310)
  5522.  
  5523.    SYNOPSIS
  5524.     days = date_YearDays(year,calendar);
  5525.      d0               d0    d1
  5526.  
  5527.     unsigned short date_YearDays(const long year,
  5528.         const date_Calendars calendar);
  5529.  
  5530.    FUNCTION
  5531.     YearDays gives you back the number of days in
  5532.     a specified year.
  5533.  
  5534.    INPUTS
  5535.     year     - The year in which to count the days.
  5536.     calendar - Calendar system to use
  5537.  
  5538.    RESULT
  5539.     days - The number of days the year uses.
  5540.  
  5541.    EXAMPLE
  5542.     unsigned short days;
  5543.     ...
  5544.     days = date_YearDays(1994,date_Gregorian);
  5545.     printf("Days of 1994 : %hu\n",days);
  5546.     ...
  5547.  
  5548.    NOTES
  5549.     It is better only to use this function for years from 8 to 8000!
  5550.  
  5551.    BUGS
  5552.     No known bugs.
  5553.  
  5554.    SEE ALSO
  5555.     JulianYearDays(),GregorianYearDays(),HeisYearDays()
  5556.  
  5557. Date/YearToScaliger                       Date/YearToScaliger
  5558.  
  5559.    NAME
  5560.     YearToScaliger -- Returns the year as Scaliger year. (V33.310)
  5561.  
  5562.    SYNOPSIS
  5563.     syear = date_YearToScaliger(year,calendar);
  5564.      d0                  d0    d1
  5565.  
  5566.     unsigned long date_YearToScaliger(const long year,
  5567.         const date_Calendars calendar);
  5568.  
  5569.    FUNCTION
  5570.     Returns the Scaliger year.
  5571.  
  5572.    INPUTS
  5573.     year     - year
  5574.     calendar - Calendar system to use
  5575.  
  5576.    RESULT
  5577.     syear - The Scaliger year
  5578.  
  5579.    EXAMPLE
  5580.     ...
  5581.     syear = date_YearToScaliger(1994,date_Gregorian);
  5582.     ...
  5583.  
  5584.    NOTES
  5585.     It is better to use this function only from 8 to 3200!
  5586.  
  5587.    BUGS
  5588.     unknown.
  5589.  
  5590.    SEE ALSO
  5591.     JYearToScaliger(),GYearToScaliger(),HYearToScaliger()
  5592.